ast: Add virtual GetKind() instead of kind member

Reduces the per-instance size for an extra vtable entry.

Change-Id: Ie087e0b8d8524adf85663ab1224fb0ae1a5e0000
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/34300
Reviewed-by: dan sinclair <dsinclair@chromium.org>
This commit is contained in:
Ben Clayton 2020-11-30 23:30:58 +00:00
parent b062bbdce8
commit 11c9de63aa
33 changed files with 137 additions and 49 deletions

View File

@ -20,10 +20,14 @@ namespace ast {
constexpr const DecorationKind AccessDecoration::Kind; constexpr const DecorationKind AccessDecoration::Kind;
AccessDecoration::AccessDecoration(AccessControl val, const Source& source) AccessDecoration::AccessDecoration(AccessControl val, const Source& source)
: TypeDecoration(Kind, source), value_(val) {} : TypeDecoration(source), value_(val) {}
AccessDecoration::~AccessDecoration() = default; AccessDecoration::~AccessDecoration() = default;
DecorationKind AccessDecoration::GetKind() const {
return Kind;
}
bool AccessDecoration::IsKind(DecorationKind kind) const { bool AccessDecoration::IsKind(DecorationKind kind) const {
return kind == Kind || TypeDecoration::IsKind(kind); return kind == Kind || TypeDecoration::IsKind(kind);
} }

View File

@ -35,6 +35,9 @@ class AccessDecoration : public TypeDecoration {
explicit AccessDecoration(AccessControl value, const Source& source); explicit AccessDecoration(AccessControl value, const Source& source);
~AccessDecoration() override; ~AccessDecoration() override;
/// @return the decoration kind
DecorationKind GetKind() const override;
/// @param kind the decoration kind /// @param kind the decoration kind
/// @return true if this Decoration is of the (or derives from) the given /// @return true if this Decoration is of the (or derives from) the given
/// kind. /// kind.

View File

@ -23,11 +23,14 @@ namespace ast {
constexpr const DecorationKind ArrayDecoration::Kind; constexpr const DecorationKind ArrayDecoration::Kind;
ArrayDecoration::ArrayDecoration(DecorationKind kind, const Source& source) ArrayDecoration::ArrayDecoration(const Source& source) : Decoration(source) {}
: Decoration(kind, source) {}
ArrayDecoration::~ArrayDecoration() = default; ArrayDecoration::~ArrayDecoration() = default;
DecorationKind ArrayDecoration::GetKind() const {
return Kind;
}
bool ArrayDecoration::IsKind(DecorationKind kind) const { bool ArrayDecoration::IsKind(DecorationKind kind) const {
return kind == Kind; return kind == Kind;
} }

View File

@ -34,6 +34,9 @@ class ArrayDecoration : public Decoration {
~ArrayDecoration() override; ~ArrayDecoration() override;
/// @return the decoration kind
DecorationKind GetKind() const override;
/// @param kind the decoration kind /// @param kind the decoration kind
/// @return true if this Decoration is of the (or derives from) the given /// @return true if this Decoration is of the (or derives from) the given
/// kind. /// kind.
@ -47,9 +50,8 @@ class ArrayDecoration : public Decoration {
protected: protected:
/// Constructor /// Constructor
/// @param kind the decoration kind
/// @param source the source of this decoration /// @param source the source of this decoration
ArrayDecoration(DecorationKind kind, const Source& source); explicit ArrayDecoration(const Source& source);
}; };
/// A list of array decorations /// A list of array decorations

View File

@ -20,10 +20,14 @@ namespace ast {
constexpr const DecorationKind BindingDecoration::Kind; constexpr const DecorationKind BindingDecoration::Kind;
BindingDecoration::BindingDecoration(uint32_t val, const Source& source) BindingDecoration::BindingDecoration(uint32_t val, const Source& source)
: VariableDecoration(Kind, source), value_(val) {} : VariableDecoration(source), value_(val) {}
BindingDecoration::~BindingDecoration() = default; BindingDecoration::~BindingDecoration() = default;
DecorationKind BindingDecoration::GetKind() const {
return Kind;
}
bool BindingDecoration::IsKind(DecorationKind kind) const { bool BindingDecoration::IsKind(DecorationKind kind) const {
return kind == Kind || VariableDecoration::IsKind(kind); return kind == Kind || VariableDecoration::IsKind(kind);
} }

View File

@ -34,6 +34,9 @@ class BindingDecoration : public VariableDecoration {
BindingDecoration(uint32_t value, const Source& source); BindingDecoration(uint32_t value, const Source& source);
~BindingDecoration() override; ~BindingDecoration() override;
/// @return the decoration kind
DecorationKind GetKind() const override;
/// @param kind the decoration kind /// @param kind the decoration kind
/// @return true if this Decoration is of the (or derives from) the given /// @return true if this Decoration is of the (or derives from) the given
/// kind. /// kind.

View File

@ -20,10 +20,14 @@ namespace ast {
constexpr const DecorationKind BuiltinDecoration::Kind; constexpr const DecorationKind BuiltinDecoration::Kind;
BuiltinDecoration::BuiltinDecoration(Builtin builtin, const Source& source) BuiltinDecoration::BuiltinDecoration(Builtin builtin, const Source& source)
: VariableDecoration(Kind, source), builtin_(builtin) {} : VariableDecoration(source), builtin_(builtin) {}
BuiltinDecoration::~BuiltinDecoration() = default; BuiltinDecoration::~BuiltinDecoration() = default;
DecorationKind BuiltinDecoration::GetKind() const {
return Kind;
}
bool BuiltinDecoration::IsKind(DecorationKind kind) const { bool BuiltinDecoration::IsKind(DecorationKind kind) const {
return kind == Kind || VariableDecoration::IsKind(kind); return kind == Kind || VariableDecoration::IsKind(kind);
} }

View File

@ -33,6 +33,9 @@ class BuiltinDecoration : public VariableDecoration {
BuiltinDecoration(Builtin builtin, const Source& source); BuiltinDecoration(Builtin builtin, const Source& source);
~BuiltinDecoration() override; ~BuiltinDecoration() override;
/// @return the decoration kind
DecorationKind GetKind() const override;
/// @param kind the decoration kind /// @param kind the decoration kind
/// @return true if this Decoration is of the (or derives from) the given /// @return true if this Decoration is of the (or derives from) the given
/// kind. /// kind.

View File

@ -20,10 +20,14 @@ namespace ast {
constexpr const DecorationKind ConstantIdDecoration::Kind; constexpr const DecorationKind ConstantIdDecoration::Kind;
ConstantIdDecoration::ConstantIdDecoration(uint32_t val, const Source& source) ConstantIdDecoration::ConstantIdDecoration(uint32_t val, const Source& source)
: VariableDecoration(Kind, source), value_(val) {} : VariableDecoration(source), value_(val) {}
ConstantIdDecoration::~ConstantIdDecoration() = default; ConstantIdDecoration::~ConstantIdDecoration() = default;
DecorationKind ConstantIdDecoration::GetKind() const {
return Kind;
}
bool ConstantIdDecoration::IsKind(DecorationKind kind) const { bool ConstantIdDecoration::IsKind(DecorationKind kind) const {
return kind == Kind || VariableDecoration::IsKind(kind); return kind == Kind || VariableDecoration::IsKind(kind);
} }

View File

@ -33,6 +33,9 @@ class ConstantIdDecoration : public VariableDecoration {
ConstantIdDecoration(uint32_t val, const Source& source); ConstantIdDecoration(uint32_t val, const Source& source);
~ConstantIdDecoration() override; ~ConstantIdDecoration() override;
/// @return the decoration kind
DecorationKind GetKind() const override;
/// @param kind the decoration kind /// @param kind the decoration kind
/// @return true if this Decoration is of the (or derives from) the given /// @return true if this Decoration is of the (or derives from) the given
/// kind. /// kind.

View File

@ -51,6 +51,9 @@ class Decoration : public Node {
public: public:
~Decoration() override; ~Decoration() override;
/// @return the decoration kind
virtual DecorationKind GetKind() const = 0;
/// @param kind the decoration kind /// @param kind the decoration kind
/// @return true if this Decoration is of the (or derives from) the given /// @return true if this Decoration is of the (or derives from) the given
/// kind. /// kind.
@ -62,21 +65,13 @@ class Decoration : public Node {
return IsKind(TO::Kind); return IsKind(TO::Kind);
} }
/// @return the decoration kind
DecorationKind GetKind() const { return kind_; }
/// @returns true if the node is valid /// @returns true if the node is valid
bool IsValid() const override; bool IsValid() const override;
protected: protected:
/// Constructor /// Constructor
/// @param kind represents the derived type
/// @param source the source of this decoration /// @param source the source of this decoration
Decoration(DecorationKind kind, const Source& source) explicit Decoration(const Source& source) : Node(source) {}
: Node(source), kind_(kind) {}
private:
DecorationKind const kind_;
}; };
/// As dynamically casts |deco| to the target type |TO|. /// As dynamically casts |deco| to the target type |TO|.

View File

@ -24,12 +24,15 @@ namespace ast {
constexpr const DecorationKind FunctionDecoration::Kind; constexpr const DecorationKind FunctionDecoration::Kind;
FunctionDecoration::FunctionDecoration(DecorationKind kind, FunctionDecoration::FunctionDecoration(const Source& source)
const Source& source) : Decoration(source) {}
: Decoration(kind, source) {}
FunctionDecoration::~FunctionDecoration() = default; FunctionDecoration::~FunctionDecoration() = default;
DecorationKind FunctionDecoration::GetKind() const {
return Kind;
}
bool FunctionDecoration::IsKind(DecorationKind kind) const { bool FunctionDecoration::IsKind(DecorationKind kind) const {
return kind == Kind; return kind == Kind;
} }

View File

@ -35,6 +35,9 @@ class FunctionDecoration : public Decoration {
~FunctionDecoration() override; ~FunctionDecoration() override;
/// @return the decoration kind
DecorationKind GetKind() const override;
/// @param kind the decoration kind /// @param kind the decoration kind
/// @return true if this Decoration is of the (or derives from) the given /// @return true if this Decoration is of the (or derives from) the given
/// kind. /// kind.
@ -52,9 +55,8 @@ class FunctionDecoration : public Decoration {
protected: protected:
/// Constructor /// Constructor
/// @param kind the decoration kind
/// @param source the source of this decoration /// @param source the source of this decoration
FunctionDecoration(DecorationKind kind, const Source& source); explicit FunctionDecoration(const Source& source);
}; };
/// A list of function decorations /// A list of function decorations

View File

@ -20,10 +20,14 @@ namespace ast {
constexpr const DecorationKind LocationDecoration::Kind; constexpr const DecorationKind LocationDecoration::Kind;
LocationDecoration::LocationDecoration(uint32_t val, const Source& source) LocationDecoration::LocationDecoration(uint32_t val, const Source& source)
: VariableDecoration(Kind, source), value_(val) {} : VariableDecoration(source), value_(val) {}
LocationDecoration::~LocationDecoration() = default; LocationDecoration::~LocationDecoration() = default;
DecorationKind LocationDecoration::GetKind() const {
return Kind;
}
bool LocationDecoration::IsKind(DecorationKind kind) const { bool LocationDecoration::IsKind(DecorationKind kind) const {
return kind == Kind || VariableDecoration::IsKind(kind); return kind == Kind || VariableDecoration::IsKind(kind);
} }

View File

@ -34,6 +34,9 @@ class LocationDecoration : public VariableDecoration {
explicit LocationDecoration(uint32_t value, const Source& source); explicit LocationDecoration(uint32_t value, const Source& source);
~LocationDecoration() override; ~LocationDecoration() override;
/// @return the decoration kind
DecorationKind GetKind() const override;
/// @param kind the decoration kind /// @param kind the decoration kind
/// @return true if this Decoration is of the (or derives from) the given /// @return true if this Decoration is of the (or derives from) the given
/// kind. /// kind.

View File

@ -18,7 +18,7 @@ namespace tint {
namespace ast { namespace ast {
SetDecoration::SetDecoration(uint32_t val, const Source& source) SetDecoration::SetDecoration(uint32_t val, const Source& source)
: VariableDecoration(Kind, source), value_(val) {} : VariableDecoration(source), value_(val) {}
SetDecoration::~SetDecoration() = default; SetDecoration::~SetDecoration() = default;

View File

@ -20,10 +20,14 @@ namespace ast {
constexpr const DecorationKind StageDecoration::Kind; constexpr const DecorationKind StageDecoration::Kind;
StageDecoration::StageDecoration(ast::PipelineStage stage, const Source& source) StageDecoration::StageDecoration(ast::PipelineStage stage, const Source& source)
: FunctionDecoration(Kind, source), stage_(stage) {} : FunctionDecoration(source), stage_(stage) {}
StageDecoration::~StageDecoration() = default; StageDecoration::~StageDecoration() = default;
DecorationKind StageDecoration::GetKind() const {
return Kind;
}
bool StageDecoration::IsKind(DecorationKind kind) const { bool StageDecoration::IsKind(DecorationKind kind) const {
return kind == Kind || FunctionDecoration::IsKind(kind); return kind == Kind || FunctionDecoration::IsKind(kind);
} }

View File

@ -33,6 +33,9 @@ class StageDecoration : public FunctionDecoration {
StageDecoration(ast::PipelineStage stage, const Source& source); StageDecoration(ast::PipelineStage stage, const Source& source);
~StageDecoration() override; ~StageDecoration() override;
/// @return the decoration kind
DecorationKind GetKind() const override;
/// @param kind the decoration kind /// @param kind the decoration kind
/// @return true if this Decoration is of the (or derives from) the given /// @return true if this Decoration is of the (or derives from) the given
/// kind. /// kind.

View File

@ -20,7 +20,11 @@ namespace ast {
constexpr const DecorationKind StrideDecoration::Kind; constexpr const DecorationKind StrideDecoration::Kind;
StrideDecoration::StrideDecoration(uint32_t stride, const Source& source) StrideDecoration::StrideDecoration(uint32_t stride, const Source& source)
: ArrayDecoration(Kind, source), stride_(stride) {} : ArrayDecoration(source), stride_(stride) {}
DecorationKind StrideDecoration::GetKind() const {
return Kind;
}
bool StrideDecoration::IsKind(DecorationKind kind) const { bool StrideDecoration::IsKind(DecorationKind kind) const {
return kind == Kind || ArrayDecoration::IsKind(kind); return kind == Kind || ArrayDecoration::IsKind(kind);

View File

@ -36,6 +36,9 @@ class StrideDecoration : public ArrayDecoration {
StrideDecoration(uint32_t stride, const Source& source); StrideDecoration(uint32_t stride, const Source& source);
~StrideDecoration() override; ~StrideDecoration() override;
/// @return the decoration kind
DecorationKind GetKind() const override;
/// @param kind the decoration kind /// @param kind the decoration kind
/// @return true if this Decoration is of the (or derives from) the given /// @return true if this Decoration is of the (or derives from) the given
/// kind. /// kind.

View File

@ -18,7 +18,7 @@ namespace tint {
namespace ast { namespace ast {
StructBlockDecoration::StructBlockDecoration(const Source& source) StructBlockDecoration::StructBlockDecoration(const Source& source)
: StructDecoration(Kind, source) {} : StructDecoration(source) {}
StructBlockDecoration::~StructBlockDecoration() = default; StructBlockDecoration::~StructBlockDecoration() = default;

View File

@ -19,11 +19,14 @@ namespace ast {
constexpr const DecorationKind StructDecoration::Kind; constexpr const DecorationKind StructDecoration::Kind;
StructDecoration::StructDecoration(DecorationKind kind, const Source& source) StructDecoration::StructDecoration(const Source& source) : Decoration(source) {}
: Decoration(kind, source) {}
StructDecoration::~StructDecoration() = default; StructDecoration::~StructDecoration() = default;
DecorationKind StructDecoration::GetKind() const {
return Kind;
}
bool StructDecoration::IsKind(DecorationKind kind) const { bool StructDecoration::IsKind(DecorationKind kind) const {
return kind == Kind; return kind == Kind;
} }

View File

@ -32,6 +32,9 @@ class StructDecoration : public Decoration {
~StructDecoration() override; ~StructDecoration() override;
/// @return the decoration kind
DecorationKind GetKind() const override;
/// @param kind the decoration kind /// @param kind the decoration kind
/// @return true if this Decoration is of the (or derives from) the given /// @return true if this Decoration is of the (or derives from) the given
/// kind. /// kind.
@ -42,9 +45,8 @@ class StructDecoration : public Decoration {
protected: protected:
/// Constructor /// Constructor
/// @param kind the decoration kind
/// @param source the source of this decoration /// @param source the source of this decoration
explicit StructDecoration(DecorationKind kind, const Source& source); explicit StructDecoration(const Source& source);
}; };
/// List of struct decorations /// List of struct decorations

View File

@ -23,12 +23,15 @@ namespace ast {
constexpr const DecorationKind StructMemberDecoration::Kind; constexpr const DecorationKind StructMemberDecoration::Kind;
StructMemberDecoration::StructMemberDecoration(DecorationKind kind, StructMemberDecoration::StructMemberDecoration(const Source& source)
const Source& source) : Decoration(source) {}
: Decoration(kind, source) {}
StructMemberDecoration::~StructMemberDecoration() = default; StructMemberDecoration::~StructMemberDecoration() = default;
DecorationKind StructMemberDecoration::GetKind() const {
return Kind;
}
bool StructMemberDecoration::IsKind(DecorationKind kind) const { bool StructMemberDecoration::IsKind(DecorationKind kind) const {
return kind == Kind; return kind == Kind;
} }

View File

@ -34,6 +34,9 @@ class StructMemberDecoration : public Decoration {
~StructMemberDecoration() override; ~StructMemberDecoration() override;
/// @return the decoration kind
DecorationKind GetKind() const override;
/// @param kind the decoration kind /// @param kind the decoration kind
/// @return true if this Decoration is of the (or derives from) the given /// @return true if this Decoration is of the (or derives from) the given
/// kind. /// kind.
@ -47,9 +50,8 @@ class StructMemberDecoration : public Decoration {
protected: protected:
/// Constructor /// Constructor
/// @param kind the decoration kind
/// @param source the source of this decoration /// @param source the source of this decoration
explicit StructMemberDecoration(DecorationKind kind, const Source& source); explicit StructMemberDecoration(const Source& source);
}; };
/// A list of struct member decorations /// A list of struct member decorations

View File

@ -21,7 +21,11 @@ constexpr const DecorationKind StructMemberOffsetDecoration::Kind;
StructMemberOffsetDecoration::StructMemberOffsetDecoration(uint32_t offset, StructMemberOffsetDecoration::StructMemberOffsetDecoration(uint32_t offset,
const Source& source) const Source& source)
: StructMemberDecoration(Kind, source), offset_(offset) {} : StructMemberDecoration(source), offset_(offset) {}
DecorationKind StructMemberOffsetDecoration::GetKind() const {
return Kind;
}
bool StructMemberOffsetDecoration::IsKind(DecorationKind kind) const { bool StructMemberOffsetDecoration::IsKind(DecorationKind kind) const {
return kind == Kind || StructMemberDecoration::IsKind(kind); return kind == Kind || StructMemberDecoration::IsKind(kind);

View File

@ -37,6 +37,9 @@ class StructMemberOffsetDecoration : public StructMemberDecoration {
StructMemberOffsetDecoration(uint32_t offset, const Source& source); StructMemberOffsetDecoration(uint32_t offset, const Source& source);
~StructMemberOffsetDecoration() override; ~StructMemberOffsetDecoration() override;
/// @return the decoration kind
DecorationKind GetKind() const override;
/// @param kind the decoration kind /// @param kind the decoration kind
/// @return true if this Decoration is of the (or derives from) the given /// @return true if this Decoration is of the (or derives from) the given
/// kind. /// kind.

View File

@ -23,11 +23,14 @@ namespace ast {
constexpr const DecorationKind TypeDecoration::Kind; constexpr const DecorationKind TypeDecoration::Kind;
TypeDecoration::TypeDecoration(DecorationKind kind, const Source& source) TypeDecoration::TypeDecoration(const Source& source) : Decoration(source) {}
: Decoration(kind, source) {}
TypeDecoration::~TypeDecoration() = default; TypeDecoration::~TypeDecoration() = default;
DecorationKind TypeDecoration::GetKind() const {
return Kind;
}
bool TypeDecoration::IsKind(DecorationKind kind) const { bool TypeDecoration::IsKind(DecorationKind kind) const {
return kind == Kind; return kind == Kind;
} }

View File

@ -35,6 +35,9 @@ class TypeDecoration : public Decoration {
~TypeDecoration() override; ~TypeDecoration() override;
/// @return the decoration kind
DecorationKind GetKind() const override;
/// @param kind the decoration kind /// @param kind the decoration kind
/// @return true if this Decoration is of the (or derives from) the given /// @return true if this Decoration is of the (or derives from) the given
/// kind. /// kind.
@ -48,9 +51,8 @@ class TypeDecoration : public Decoration {
protected: protected:
/// Constructor /// Constructor
/// @param kind the decoration kind
/// @param source the source of this decoration /// @param source the source of this decoration
explicit TypeDecoration(DecorationKind kind, const Source& source); explicit TypeDecoration(const Source& source);
}; };
/// A list of type decorations /// A list of type decorations

View File

@ -27,12 +27,15 @@ namespace ast {
constexpr const DecorationKind VariableDecoration::Kind; constexpr const DecorationKind VariableDecoration::Kind;
VariableDecoration::VariableDecoration(DecorationKind kind, VariableDecoration::VariableDecoration(const Source& source)
const Source& source) : Decoration(source) {}
: Decoration(kind, source) {}
VariableDecoration::~VariableDecoration() = default; VariableDecoration::~VariableDecoration() = default;
DecorationKind VariableDecoration::GetKind() const {
return Kind;
}
bool VariableDecoration::IsKind(DecorationKind kind) const { bool VariableDecoration::IsKind(DecorationKind kind) const {
return kind == Kind; return kind == Kind;
} }

View File

@ -39,6 +39,9 @@ class VariableDecoration : public Decoration {
~VariableDecoration() override; ~VariableDecoration() override;
/// @return the decoration kind
DecorationKind GetKind() const override;
/// @param kind the decoration kind /// @param kind the decoration kind
/// @return true if this Decoration is of the (or derives from) the given /// @return true if this Decoration is of the (or derives from) the given
/// kind. /// kind.
@ -68,9 +71,8 @@ class VariableDecoration : public Decoration {
protected: protected:
/// Constructor /// Constructor
/// @param kind the decoration kind
/// @param source the source of this decoration /// @param source the source of this decoration
VariableDecoration(DecorationKind kind, const Source& source); explicit VariableDecoration(const Source& source);
}; };
/// A list of variable decorations /// A list of variable decorations

View File

@ -20,21 +20,25 @@ namespace ast {
constexpr const DecorationKind WorkgroupDecoration::Kind; constexpr const DecorationKind WorkgroupDecoration::Kind;
WorkgroupDecoration::WorkgroupDecoration(uint32_t x, const Source& source) WorkgroupDecoration::WorkgroupDecoration(uint32_t x, const Source& source)
: FunctionDecoration(Kind, source), x_(x) {} : FunctionDecoration(source), x_(x) {}
WorkgroupDecoration::WorkgroupDecoration(uint32_t x, WorkgroupDecoration::WorkgroupDecoration(uint32_t x,
uint32_t y, uint32_t y,
const Source& source) const Source& source)
: FunctionDecoration(Kind, source), x_(x), y_(y) {} : FunctionDecoration(source), x_(x), y_(y) {}
WorkgroupDecoration::WorkgroupDecoration(uint32_t x, WorkgroupDecoration::WorkgroupDecoration(uint32_t x,
uint32_t y, uint32_t y,
uint32_t z, uint32_t z,
const Source& source) const Source& source)
: FunctionDecoration(Kind, source), x_(x), y_(y), z_(z) {} : FunctionDecoration(source), x_(x), y_(y), z_(z) {}
WorkgroupDecoration::~WorkgroupDecoration() = default; WorkgroupDecoration::~WorkgroupDecoration() = default;
DecorationKind WorkgroupDecoration::GetKind() const {
return Kind;
}
bool WorkgroupDecoration::IsKind(DecorationKind kind) const { bool WorkgroupDecoration::IsKind(DecorationKind kind) const {
return kind == Kind || FunctionDecoration::IsKind(kind); return kind == Kind || FunctionDecoration::IsKind(kind);
} }

View File

@ -47,6 +47,9 @@ class WorkgroupDecoration : public FunctionDecoration {
WorkgroupDecoration(uint32_t x, uint32_t y, uint32_t z, const Source& source); WorkgroupDecoration(uint32_t x, uint32_t y, uint32_t z, const Source& source);
~WorkgroupDecoration() override; ~WorkgroupDecoration() override;
/// @return the decoration kind
DecorationKind GetKind() const override;
/// @param kind the decoration kind /// @param kind the decoration kind
/// @return true if this Decoration is of the (or derives from) the given /// @return true if this Decoration is of the (or derives from) the given
/// kind. /// kind.