DeclNodes.td 4.9 KB

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