clang 22.0.0git
|
Kind identifier. More...
#include "clang/AST/ASTTypeTraits.h"
Classes | |
struct | DenseMapInfo |
Hooks for using ASTNodeKind as a key in a DenseMap. More... |
Public Member Functions | |
constexpr | ASTNodeKind () |
Empty identifier. It matches nothing. | |
constexpr bool | isSame (ASTNodeKind Other) const |
Returns true if this and Other represent the same kind. | |
constexpr bool | isNone () const |
Returns true only for the default ASTNodeKind() | |
bool | isBaseOf (ASTNodeKind Other) const |
Returns true if this is a base kind of (or same as) Other . | |
bool | isBaseOf (ASTNodeKind Other, unsigned *Distance) const |
Returns true if this is a base kind of (or same as) Other . | |
StringRef | asStringRef () const |
String representation of the kind. | |
constexpr bool | operator< (const ASTNodeKind &Other) const |
Strict weak ordering for ASTNodeKind. | |
ASTNodeKind | getCladeKind () const |
constexpr bool | hasPointerIdentity () const |
Check if the given ASTNodeKind identifies a type that offers pointer identity. |
Static Public Member Functions | |
template<class T> | |
static constexpr ASTNodeKind | getFromNodeKind () |
Construct an identifier for T. | |
static ASTNodeKind | getMostDerivedType (ASTNodeKind Kind1, ASTNodeKind Kind2) |
Return the most derived type between Kind1 and Kind2 . | |
static ASTNodeKind | getMostDerivedCommonAncestor (ASTNodeKind Kind1, ASTNodeKind Kind2) |
Return the most derived common ancestor between Kind1 and Kind2. | |
static ASTNodeKind | getFromNode (const Decl &D) |
static ASTNodeKind | getFromNode (const Stmt &S) |
static ASTNodeKind | getFromNode (const Type &T) |
static ASTNodeKind | getFromNode (const TypeLoc &T) |
static ASTNodeKind | getFromNode (const LambdaCapture &L) |
static ASTNodeKind | getFromNode (const OMPClause &C) |
static ASTNodeKind | getFromNode (const Attr &A) |
Kind identifier.
It can be constructed from any node kind and allows for runtime type hierarchy checks. Use getFromNodeKind<T>() to construct them.
Definition at line 51 of file ASTTypeTraits.h.
|
inlineconstexpr |
Empty identifier. It matches nothing.
Definition at line 54 of file ASTTypeTraits.h.
Referenced by getCladeKind(), clang::ASTNodeKind::DenseMapInfo::getEmptyKey(), getFromNode(), getFromNode(), getFromNode(), getFromNode(), getFromNode(), getFromNode(), getFromNode(), getFromNodeKind(), clang::ASTNodeKind::DenseMapInfo::getHashValue(), getMostDerivedCommonAncestor(), getMostDerivedType(), clang::ASTNodeKind::DenseMapInfo::getTombstoneKey(), isBaseOf(), isBaseOf(), clang::ASTNodeKind::DenseMapInfo::isEqual(), isSame(), and operator<().
StringRef ASTNodeKind::asStringRef | ( | ) | const |
String representation of the kind.
Definition at line 102 of file ASTTypeTraits.cpp.
Referenced by clang::ast_matchers::dynamic::VariantValue::getTypeAsString(), and clang::operator<<().
ASTNodeKind ASTNodeKind::getCladeKind | ( | ) | const |
Definition at line 91 of file ASTTypeTraits.cpp.
References ASTNodeKind().
Referenced by clang::ast_matchers::dynamic::internal::MapAnyOfBuilderDescriptor::buildMatcherCtor().
|
static |
Definition at line 176 of file ASTTypeTraits.cpp.
References ASTNodeKind(), and clang::Attr::getKind().
|
static |
Construct an identifier for the dynamic type of the node
Definition at line 120 of file ASTTypeTraits.cpp.
References ASTNodeKind(), and clang::Decl::getKind().
|
static |
References ASTNodeKind(), and clang::C.
|
static |
Definition at line 162 of file ASTTypeTraits.cpp.
References ASTNodeKind(), and clang::C.
|
static |
Definition at line 130 of file ASTTypeTraits.cpp.
References ASTNodeKind(), clang::Stmt::getStmtClass(), and clang::Stmt::NoStmtClass.
|
static |
Definition at line 141 of file ASTTypeTraits.cpp.
References ASTNodeKind(), and clang::T.
|
static |
Definition at line 151 of file ASTTypeTraits.cpp.
References ASTNodeKind(), and clang::T.
|
inlinestaticconstexpr |
Construct an identifier for T.
Definition at line 57 of file ASTTypeTraits.h.
References ASTNodeKind().
Referenced by clang::ast_matchers::dynamic::internal::BuildReturnTypeVector< ast_matchers::internal::BindableMatcher< T > >::build(), clang::ast_matchers::dynamic::internal::BuildReturnTypeVector< ast_matchers::internal::Matcher< T > >::build(), clang::ast_matchers::dynamic::internal::buildReturnTypeVectorFromTypeList(), clang::ast_matchers::dynamic::Registry::getAcceptedCompletionTypes(), clang::DynTypedNode::DenseMapInfo::getHashValue(), clang::ast_matchers::dynamic::internal::ArgTypeTraits< ast_matchers::internal::Matcher< T > >::getKind(), clang::ast_matchers::dynamic::VariantMatcher::getTypedMatcher(), clang::ast_matchers::dynamic::VariantMatcher::hasTypedMatcher(), clang::ast_matchers::dynamic::internal::makeMatcherAutoMarshall(), clang::DynTypedNode::operator<(), and clang::DynTypedNode::operator==().
|
static |
Return the most derived common ancestor between Kind1 and Kind2.
Return ASTNodeKind() if they are not related.
Definition at line 111 of file ASTTypeTraits.cpp.
References ASTNodeKind(), and isBaseOf().
|
static |
Return the most derived type between Kind1
and Kind2
.
Return ASTNodeKind() if they are not related.
Definition at line 104 of file ASTTypeTraits.cpp.
References ASTNodeKind(), and isBaseOf().
|
inlineconstexpr |
Check if the given ASTNodeKind identifies a type that offers pointer identity.
This is useful for the fast path in DynTypedNode.
Definition at line 126 of file ASTTypeTraits.h.
Referenced by clang::ParentMapContext::ParentMap::getParents().
bool ASTNodeKind::isBaseOf | ( | ASTNodeKind | Other | ) | const |
Returns true
if this
is a base kind of (or same as) Other
.
Definition at line 61 of file ASTTypeTraits.cpp.
References ASTNodeKind(), isBaseOf(), and clang::Other.
Referenced by getMostDerivedCommonAncestor(), getMostDerivedType(), isBaseOf(), and isBaseOf().
bool ASTNodeKind::isBaseOf | ( | ASTNodeKind | Other, |
unsigned * | Distance ) const |
Returns true
if this
is a base kind of (or same as) Other
.
Distance | If non-null, used to return the distance between this and Other in the class hierarchy. |
Definition at line 65 of file ASTTypeTraits.cpp.
References ASTNodeKind(), isBaseOf(), and clang::Other.
|
inlineconstexpr |
Returns true
only for the default ASTNodeKind()
Definition at line 78 of file ASTTypeTraits.h.
|
inlineconstexpr |
Returns true
if this
and Other
represent the same kind.
Definition at line 73 of file ASTTypeTraits.h.
References ASTNodeKind(), and clang::Other.
Referenced by clang::diff::ComparisonOptions::isMatchingAllowed().
|
inlineconstexpr |
Strict weak ordering for ASTNodeKind.
Definition at line 92 of file ASTTypeTraits.h.
References ASTNodeKind(), and clang::Other.