1include "clang/Basic/ASTNode.td" 2 3class DeclNode<DeclNode base, string diagSpelling = "", bit abstract = 0> 4 : ASTNode, AttrSubject { 5 DeclNode Base = base; 6 bit Abstract = abstract; 7 string DiagSpelling = diagSpelling; 8} 9 10class DeclContext {} 11 12def Decl : DeclNode<?, "", 1>; 13def TranslationUnit : DeclNode<Decl>, DeclContext; 14def PragmaComment : DeclNode<Decl>; 15def PragmaDetectMismatch : DeclNode<Decl>; 16def ExternCContext : DeclNode<Decl>, DeclContext; 17def Named : DeclNode<Decl, "named declarations", 1>; 18 def Namespace : DeclNode<Named, "namespaces">, DeclContext; 19 def UsingDirective : DeclNode<Named>; 20 def NamespaceAlias : DeclNode<Named>; 21 def Label : DeclNode<Named, "labels">; 22 def Type : DeclNode<Named, "types", 1>; 23 def TypedefName : DeclNode<Type, "typedefs", 1>; 24 def Typedef : DeclNode<TypedefName>; 25 def TypeAlias : DeclNode<TypedefName>; 26 def ObjCTypeParam : DeclNode<TypedefName>; 27 def UnresolvedUsingTypename : DeclNode<Type>; 28 def Tag : DeclNode<Type, "tag types", 1>, DeclContext; 29 def Enum : DeclNode<Tag, "enums">; 30 def Record : DeclNode<Tag, "structs, unions, classes">; 31 def CXXRecord : DeclNode<Record, "classes">; 32 def ClassTemplateSpecialization : DeclNode<CXXRecord>; 33 def ClassTemplatePartialSpecialization 34 : DeclNode<ClassTemplateSpecialization>; 35 def TemplateTypeParm : DeclNode<Type>; 36 def Value : DeclNode<Named, "value declarations", 1>; 37 def EnumConstant : DeclNode<Value, "enumerators">; 38 def UnresolvedUsingValue : DeclNode<Value>; 39 def IndirectField : DeclNode<Value>; 40 def Binding : DeclNode<Value>; 41 def OMPDeclareReduction : DeclNode<Value>, DeclContext; 42 def OMPDeclareMapper : DeclNode<Value>, DeclContext; 43 def MSGuid : DeclNode<Value>; 44 def UnnamedGlobalConstant : DeclNode<Value>; 45 def TemplateParamObject : DeclNode<Value>; 46 def Declarator : DeclNode<Value, "declarators", 1>; 47 def Field : DeclNode<Declarator, "non-static data members">; 48 def ObjCIvar : DeclNode<Field>; 49 def ObjCAtDefsField : DeclNode<Field>; 50 def MSProperty : DeclNode<Declarator>; 51 def Function : DeclNode<Declarator, "functions">, DeclContext; 52 def CXXDeductionGuide : DeclNode<Function>; 53 def CXXMethod : DeclNode<Function>; 54 def CXXConstructor : DeclNode<CXXMethod>; 55 def CXXDestructor : DeclNode<CXXMethod>; 56 def CXXConversion : DeclNode<CXXMethod>; 57 def Var : DeclNode<Declarator, "variables">; 58 def VarTemplateSpecialization : DeclNode<Var>; 59 def VarTemplatePartialSpecialization 60 : DeclNode<VarTemplateSpecialization>; 61 def ImplicitParam : DeclNode<Var>; 62 def ParmVar : DeclNode<Var, "parameters">; 63 def Decomposition : DeclNode<Var>; 64 def OMPCapturedExpr : DeclNode<Var>; 65 def NonTypeTemplateParm : DeclNode<Declarator>; 66 def Template : DeclNode<Named, "templates", 1>; 67 def RedeclarableTemplate : DeclNode<Template, "redeclarable templates", 1>; 68 def FunctionTemplate : DeclNode<RedeclarableTemplate>; 69 def ClassTemplate : DeclNode<RedeclarableTemplate>; 70 def VarTemplate : DeclNode<RedeclarableTemplate>; 71 def TypeAliasTemplate : DeclNode<RedeclarableTemplate>; 72 def TemplateTemplateParm : DeclNode<Template>; 73 def BuiltinTemplate : DeclNode<Template>; 74 def Concept : DeclNode<Template>; 75 def BaseUsing : DeclNode<Named, "", 1>; 76 def Using : DeclNode<BaseUsing>; 77 def UsingEnum : DeclNode<BaseUsing>; 78 def UsingPack : DeclNode<Named>; 79 def UsingShadow : DeclNode<Named>; 80 def ConstructorUsingShadow : DeclNode<UsingShadow>; 81 def UnresolvedUsingIfExists : DeclNode<Named>; 82 def ObjCMethod : DeclNode<Named, "Objective-C methods">, DeclContext; 83 def ObjCContainer : DeclNode<Named, "Objective-C containers", 1>, DeclContext; 84 def ObjCCategory : DeclNode<ObjCContainer>; 85 def ObjCProtocol : DeclNode<ObjCContainer, "Objective-C protocols">; 86 def ObjCInterface : DeclNode<ObjCContainer, "Objective-C interfaces">; 87 def ObjCImpl 88 : DeclNode<ObjCContainer, "Objective-C implementation declarations", 1>; 89 def ObjCCategoryImpl : DeclNode<ObjCImpl>; 90 def ObjCImplementation : DeclNode<ObjCImpl>; 91 def ObjCProperty : DeclNode<Named, "Objective-C properties">; 92 def ObjCCompatibleAlias : DeclNode<Named>; 93def ImplicitConceptSpecialization : DeclNode<Decl>; 94def LinkageSpec : DeclNode<Decl>, DeclContext; 95def Export : DeclNode<Decl>, DeclContext; 96def ObjCPropertyImpl : DeclNode<Decl>; 97def FileScopeAsm : DeclNode<Decl>; 98def TopLevelStmt : DeclNode<Decl>, DeclContext; 99def AccessSpec : DeclNode<Decl>; 100def Friend : DeclNode<Decl>; 101def FriendTemplate : DeclNode<Decl>; 102def StaticAssert : DeclNode<Decl>; 103def Block : DeclNode<Decl, "blocks">, DeclContext; 104def Captured : DeclNode<Decl>, DeclContext; 105def Import : DeclNode<Decl>; 106def OMPThreadPrivate : DeclNode<Decl>; 107def OMPAllocate : DeclNode<Decl>; 108def OMPRequires : DeclNode<Decl>; 109def Empty : DeclNode<Decl>; 110def RequiresExprBody : DeclNode<Decl>, DeclContext; 111def LifetimeExtendedTemporary : DeclNode<Decl>; 112def HLSLBuffer : DeclNode<Named, "HLSLBuffer">, DeclContext; 113