Home | History | Annotate | Download | only in AST

Lines Matching defs:ASTNodeKind

46 class ASTNodeKind {
49 ASTNodeKind() : KindId(NKI_None) {}
53 static ASTNodeKind getFromNodeKind() {
54 return ASTNodeKind(KindToKindId<T>::Id);
59 static ASTNodeKind getFromNode(const Decl &D);
60 static ASTNodeKind getFromNode(const Stmt &S);
61 static ASTNodeKind getFromNode(const Type &T);
65 bool isSame(ASTNodeKind Other) const {
69 /// \brief Returns \c true only for the default \c ASTNodeKind()
75 bool isBaseOf(ASTNodeKind Other, unsigned *Distance = nullptr) const;
80 /// \brief Strict weak ordering for ASTNodeKind.
81 bool operator<(const ASTNodeKind &Other) const {
87 /// Return ASTNodeKind() if they are not related.
88 static ASTNodeKind getMostDerivedType(ASTNodeKind Kind1, ASTNodeKind Kind2);
92 /// Return ASTNodeKind() if they are not related.
93 static ASTNodeKind getMostDerivedCommonAncestor(ASTNodeKind Kind1,
94 ASTNodeKind Kind2);
96 /// \brief Hooks for using ASTNodeKind as a key in a DenseMap.
98 // ASTNodeKind() is a good empty key because it is represented as a 0.
99 static inline ASTNodeKind getEmptyKey() { return ASTNodeKind(); }
102 static inline ASTNodeKind getTombstoneKey() {
103 return ASTNodeKind(NKI_NumberOfKinds);
105 static unsigned getHashValue(const ASTNodeKind &Val) { return Val.KindId; }
106 static bool isEqual(const ASTNodeKind &LHS, const ASTNodeKind &RHS) {
111 /// Check if the given ASTNodeKind identifies a type that offers pointer
143 ASTNodeKind(NodeKindId KindId) : KindId(KindId) {}
173 template <> struct ASTNodeKind::KindToKindId<Class> { \
193 inline raw_ostream &operator<<(raw_ostream &OS, ASTNodeKind K) {
207 /// See \c ASTNodeKind for which node base types are currently supported;
243 ASTNodeKind getNodeKind() const { return NodeKind; }
276 if (ASTNodeKind::getFromNodeKind<QualType>().isSame(NodeKind))
280 if (ASTNodeKind::getFromNodeKind<TypeLoc>().isSame(NodeKind)) {
289 if (ASTNodeKind::getFromNodeKind<NestedNameSpecifierLoc>().isSame(
309 if (ASTNodeKind::getFromNodeKind<QualType>().isSame(NodeKind))
312 if (ASTNodeKind::getFromNodeKind<TypeLoc>().isSame(NodeKind))
315 if (ASTNodeKind::getFromNodeKind<NestedNameSpecifierLoc>().isSame(NodeKind))
331 Node.NodeKind = ASTNodeKind::DenseMapInfo::getEmptyKey();
336 Node.NodeKind = ASTNodeKind::DenseMapInfo::getTombstoneKey();
341 if (ASTNodeKind::getFromNodeKind<TypeLoc>().isSame(Val.NodeKind)) {
347 if (ASTNodeKind::getFromNodeKind<NestedNameSpecifierLoc>().isSame(
358 auto Empty = ASTNodeKind::DenseMapInfo::getEmptyKey();
359 auto TombStone = ASTNodeKind::DenseMapInfo::getTombstoneKey();
360 return (ASTNodeKind::DenseMapInfo::isEqual(LHS.NodeKind, Empty) &&
361 ASTNodeKind::DenseMapInfo::isEqual(RHS.NodeKind, Empty)) ||
362 (ASTNodeKind::DenseMapInfo::isEqual(LHS.NodeKind, TombStone) &&
363 ASTNodeKind::DenseMapInfo::isEqual(RHS.NodeKind, TombStone)) ||
374 static const T *get(ASTNodeKind NodeKind, const char Storage[]) {
375 if (ASTNodeKind::getFromNodeKind<T>().isBaseOf(NodeKind))
379 static const T &getUnchecked(ASTNodeKind NodeKind, const char Storage[]) {
380 assert(ASTNodeKind::getFromNodeKind<T>().isBaseOf(NodeKind));
386 Result.NodeKind = ASTNodeKind::getFromNode(Node);
394 static const T *get(ASTNodeKind NodeKind, const char Storage[]) {
395 if (ASTNodeKind::getFromNodeKind<T>().isSame(NodeKind))
399 static const T &getUnchecked(ASTNodeKind NodeKind, const char Storage[]) {
400 assert(ASTNodeKind::getFromNodeKind<T>().isSame(NodeKind));
406 Result.NodeKind = ASTNodeKind::getFromNodeKind<T>();
414 static const T *get(ASTNodeKind NodeKind, const char Storage[]) {
415 if (ASTNodeKind::getFromNodeKind<T>().isSame(NodeKind))
419 static const T &getUnchecked(ASTNodeKind NodeKind, const char Storage[]) {
420 assert(ASTNodeKind::getFromNodeKind<T>().isSame(NodeKind));
425 Result.NodeKind = ASTNodeKind::getFromNodeKind<T>();
431 ASTNodeKind NodeKind;
491 static const T *get(ASTNodeKind NodeKind, const char Storage[]) {
502 struct DenseMapInfo<clang::ast_type_traits::ASTNodeKind>
503 : clang::ast_type_traits::ASTNodeKind::DenseMapInfo {};