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 TemplateParamObject : DeclNode<Value>;
45 def Declarator : DeclNode<Value, "declarators", 1>;
46 def Field : DeclNode<Declarator, "non-static data members">;
47 def ObjCIvar : DeclNode<Field>;
48 def ObjCAtDefsField : DeclNode<Field>;
49 def MSProperty : DeclNode<Declarator>;
50 def Function : DeclNode<Declarator, "functions">, DeclContext;
51 def CXXDeductionGuide : DeclNode<Function>;
52 def CXXMethod : DeclNode<Function>;
53 def CXXConstructor : DeclNode<CXXMethod>;
54 def CXXDestructor : DeclNode<CXXMethod>;
55 def CXXConversion : DeclNode<CXXMethod>;
56 def Var : DeclNode<Declarator, "variables">;
57 def VarTemplateSpecialization : DeclNode<Var>;
58 def VarTemplatePartialSpecialization
59 : DeclNode<VarTemplateSpecialization>;
60 def ImplicitParam : DeclNode<Var>;
61 def ParmVar : DeclNode<Var, "parameters">;
62 def Decomposition : DeclNode<Var>;
63 def OMPCapturedExpr : DeclNode<Var>;
64 def NonTypeTemplateParm : DeclNode<Declarator>;
65 def Template : DeclNode<Named, "templates", 1>;
66 def RedeclarableTemplate : DeclNode<Template, "redeclarable templates", 1>;
67 def FunctionTemplate : DeclNode<RedeclarableTemplate>;
68 def ClassTemplate : DeclNode<RedeclarableTemplate>;
69 def VarTemplate : DeclNode<RedeclarableTemplate>;
70 def TypeAliasTemplate : DeclNode<RedeclarableTemplate>;
71 def TemplateTemplateParm : DeclNode<Template>;
72 def BuiltinTemplate : DeclNode<Template>;
73 def Concept : DeclNode<Template>;
74 def Using : DeclNode<Named>;
75 def UsingPack : DeclNode<Named>;
76 def UsingShadow : DeclNode<Named>;
77 def ConstructorUsingShadow : DeclNode<UsingShadow>;
78 def ObjCMethod : DeclNode<Named, "Objective-C methods">, DeclContext;
79 def ObjCContainer : DeclNode<Named, "Objective-C containers", 1>, DeclContext;
80 def ObjCCategory : DeclNode<ObjCContainer>;
81 def ObjCProtocol : DeclNode<ObjCContainer, "Objective-C protocols">;
82 def ObjCInterface : DeclNode<ObjCContainer, "Objective-C interfaces">;
83 def ObjCImpl
84 : DeclNode<ObjCContainer, "Objective-C implementation declarations", 1>;
85 def ObjCCategoryImpl : DeclNode<ObjCImpl>;
86 def ObjCImplementation : DeclNode<ObjCImpl>;
87 def ObjCProperty : DeclNode<Named, "Objective-C properties">;
88 def ObjCCompatibleAlias : DeclNode<Named>;
89def LinkageSpec : DeclNode<Decl>, DeclContext;
90def Export : DeclNode<Decl>, DeclContext;
91def ObjCPropertyImpl : DeclNode<Decl>;
92def FileScopeAsm : DeclNode<Decl>;
93def AccessSpec : DeclNode<Decl>;
94def Friend : DeclNode<Decl>;
95def FriendTemplate : DeclNode<Decl>;
96def StaticAssert : DeclNode<Decl>;
97def Block : DeclNode<Decl, "blocks">, DeclContext;
98def Captured : DeclNode<Decl>, DeclContext;
99def ClassScopeFunctionSpecialization : DeclNode<Decl>;
100def Import : DeclNode<Decl>;
101def OMPThreadPrivate : DeclNode<Decl>;
102def OMPAllocate : DeclNode<Decl>;
103def OMPRequires : DeclNode<Decl>;
104def Empty : DeclNode<Decl>;
105def RequiresExprBody : DeclNode<Decl>, DeclContext;
106def LifetimeExtendedTemporary : DeclNode<Decl>;
107
108