StmtNodes.td 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285
  1. include "clang/Basic/ASTNode.td"
  2. class StmtNode<StmtNode base, bit abstract = 0> : ASTNode, AttrSubject {
  3. StmtNode Base = base;
  4. bit Abstract = abstract;
  5. }
  6. // Statements
  7. def Stmt : StmtNode<?, 1>;
  8. def NullStmt : StmtNode<Stmt>;
  9. def CompoundStmt : StmtNode<Stmt>;
  10. def IfStmt : StmtNode<Stmt>;
  11. def SwitchStmt : StmtNode<Stmt>;
  12. def WhileStmt : StmtNode<Stmt>;
  13. def DoStmt : StmtNode<Stmt>;
  14. def ForStmt : StmtNode<Stmt>;
  15. def GotoStmt : StmtNode<Stmt>;
  16. def IndirectGotoStmt : StmtNode<Stmt>;
  17. def ContinueStmt : StmtNode<Stmt>;
  18. def BreakStmt : StmtNode<Stmt>;
  19. def ReturnStmt : StmtNode<Stmt>;
  20. def DeclStmt : StmtNode<Stmt>;
  21. def SwitchCase : StmtNode<Stmt, 1>;
  22. def CaseStmt : StmtNode<SwitchCase>;
  23. def DefaultStmt : StmtNode<SwitchCase>;
  24. def CapturedStmt : StmtNode<Stmt>;
  25. // Statements that might produce a value (for example, as the last non-null
  26. // statement in a GNU statement-expression).
  27. def ValueStmt : StmtNode<Stmt, 1>;
  28. def LabelStmt : StmtNode<ValueStmt>;
  29. def AttributedStmt : StmtNode<ValueStmt>;
  30. // Asm statements
  31. def AsmStmt : StmtNode<Stmt, 1>;
  32. def GCCAsmStmt : StmtNode<AsmStmt>;
  33. def MSAsmStmt : StmtNode<AsmStmt>;
  34. // Obj-C statements
  35. def ObjCAtTryStmt : StmtNode<Stmt>;
  36. def ObjCAtCatchStmt : StmtNode<Stmt>;
  37. def ObjCAtFinallyStmt : StmtNode<Stmt>;
  38. def ObjCAtThrowStmt : StmtNode<Stmt>;
  39. def ObjCAtSynchronizedStmt : StmtNode<Stmt>;
  40. def ObjCForCollectionStmt : StmtNode<Stmt>;
  41. def ObjCAutoreleasePoolStmt : StmtNode<Stmt>;
  42. // C++ statements
  43. def CXXCatchStmt : StmtNode<Stmt>;
  44. def CXXTryStmt : StmtNode<Stmt>;
  45. def CXXForRangeStmt : StmtNode<Stmt>;
  46. // C++ Coroutines TS statements
  47. def CoroutineBodyStmt : StmtNode<Stmt>;
  48. def CoreturnStmt : StmtNode<Stmt>;
  49. // Expressions
  50. def Expr : StmtNode<ValueStmt, 1>;
  51. def PredefinedExpr : StmtNode<Expr>;
  52. def SYCLUniqueStableNameExpr : StmtNode<Expr>;
  53. def DeclRefExpr : StmtNode<Expr>;
  54. def IntegerLiteral : StmtNode<Expr>;
  55. def FixedPointLiteral : StmtNode<Expr>;
  56. def FloatingLiteral : StmtNode<Expr>;
  57. def ImaginaryLiteral : StmtNode<Expr>;
  58. def StringLiteral : StmtNode<Expr>;
  59. def CharacterLiteral : StmtNode<Expr>;
  60. def ParenExpr : StmtNode<Expr>;
  61. def UnaryOperator : StmtNode<Expr>;
  62. def OffsetOfExpr : StmtNode<Expr>;
  63. def UnaryExprOrTypeTraitExpr : StmtNode<Expr>;
  64. def ArraySubscriptExpr : StmtNode<Expr>;
  65. def MatrixSubscriptExpr : StmtNode<Expr>;
  66. def OMPArraySectionExpr : StmtNode<Expr>;
  67. def OMPIteratorExpr : StmtNode<Expr>;
  68. def CallExpr : StmtNode<Expr>;
  69. def MemberExpr : StmtNode<Expr>;
  70. def CastExpr : StmtNode<Expr, 1>;
  71. def BinaryOperator : StmtNode<Expr>;
  72. def CompoundAssignOperator : StmtNode<BinaryOperator>;
  73. def AbstractConditionalOperator : StmtNode<Expr, 1>;
  74. def ConditionalOperator : StmtNode<AbstractConditionalOperator>;
  75. def BinaryConditionalOperator : StmtNode<AbstractConditionalOperator>;
  76. def ImplicitCastExpr : StmtNode<CastExpr>;
  77. def ExplicitCastExpr : StmtNode<CastExpr, 1>;
  78. def CStyleCastExpr : StmtNode<ExplicitCastExpr>;
  79. def OMPArrayShapingExpr : StmtNode<Expr>;
  80. def CompoundLiteralExpr : StmtNode<Expr>;
  81. def ExtVectorElementExpr : StmtNode<Expr>;
  82. def InitListExpr : StmtNode<Expr>;
  83. def DesignatedInitExpr : StmtNode<Expr>;
  84. def DesignatedInitUpdateExpr : StmtNode<Expr>;
  85. def ImplicitValueInitExpr : StmtNode<Expr>;
  86. def NoInitExpr : StmtNode<Expr>;
  87. def ArrayInitLoopExpr : StmtNode<Expr>;
  88. def ArrayInitIndexExpr : StmtNode<Expr>;
  89. def ParenListExpr : StmtNode<Expr>;
  90. def VAArgExpr : StmtNode<Expr>;
  91. def GenericSelectionExpr : StmtNode<Expr>;
  92. def PseudoObjectExpr : StmtNode<Expr>;
  93. def SourceLocExpr : StmtNode<Expr>;
  94. // Wrapper expressions
  95. def FullExpr : StmtNode<Expr, 1>;
  96. def ConstantExpr : StmtNode<FullExpr>;
  97. // Atomic expressions
  98. def AtomicExpr : StmtNode<Expr>;
  99. // GNU Extensions.
  100. def AddrLabelExpr : StmtNode<Expr>;
  101. def StmtExpr : StmtNode<Expr>;
  102. def ChooseExpr : StmtNode<Expr>;
  103. def GNUNullExpr : StmtNode<Expr>;
  104. // C++ Expressions.
  105. def CXXOperatorCallExpr : StmtNode<CallExpr>;
  106. def CXXMemberCallExpr : StmtNode<CallExpr>;
  107. def CXXRewrittenBinaryOperator : StmtNode<Expr>;
  108. def CXXNamedCastExpr : StmtNode<ExplicitCastExpr, 1>;
  109. def CXXStaticCastExpr : StmtNode<CXXNamedCastExpr>;
  110. def CXXDynamicCastExpr : StmtNode<CXXNamedCastExpr>;
  111. def CXXReinterpretCastExpr : StmtNode<CXXNamedCastExpr>;
  112. def CXXConstCastExpr : StmtNode<CXXNamedCastExpr>;
  113. def CXXAddrspaceCastExpr : StmtNode<CXXNamedCastExpr>;
  114. def CXXFunctionalCastExpr : StmtNode<ExplicitCastExpr>;
  115. def CXXTypeidExpr : StmtNode<Expr>;
  116. def UserDefinedLiteral : StmtNode<CallExpr>;
  117. def CXXBoolLiteralExpr : StmtNode<Expr>;
  118. def CXXNullPtrLiteralExpr : StmtNode<Expr>;
  119. def CXXThisExpr : StmtNode<Expr>;
  120. def CXXThrowExpr : StmtNode<Expr>;
  121. def CXXDefaultArgExpr : StmtNode<Expr>;
  122. def CXXDefaultInitExpr : StmtNode<Expr>;
  123. def CXXScalarValueInitExpr : StmtNode<Expr>;
  124. def CXXStdInitializerListExpr : StmtNode<Expr>;
  125. def CXXNewExpr : StmtNode<Expr>;
  126. def CXXDeleteExpr : StmtNode<Expr>;
  127. def CXXPseudoDestructorExpr : StmtNode<Expr>;
  128. def TypeTraitExpr : StmtNode<Expr>;
  129. def ArrayTypeTraitExpr : StmtNode<Expr>;
  130. def ExpressionTraitExpr : StmtNode<Expr>;
  131. def DependentScopeDeclRefExpr : StmtNode<Expr>;
  132. def CXXConstructExpr : StmtNode<Expr>;
  133. def CXXInheritedCtorInitExpr : StmtNode<Expr>;
  134. def CXXBindTemporaryExpr : StmtNode<Expr>;
  135. def ExprWithCleanups : StmtNode<FullExpr>;
  136. def CXXTemporaryObjectExpr : StmtNode<CXXConstructExpr>;
  137. def CXXUnresolvedConstructExpr : StmtNode<Expr>;
  138. def CXXDependentScopeMemberExpr : StmtNode<Expr>;
  139. def OverloadExpr : StmtNode<Expr, 1>;
  140. def UnresolvedLookupExpr : StmtNode<OverloadExpr>;
  141. def UnresolvedMemberExpr : StmtNode<OverloadExpr>;
  142. def CXXNoexceptExpr : StmtNode<Expr>;
  143. def PackExpansionExpr : StmtNode<Expr>;
  144. def SizeOfPackExpr : StmtNode<Expr>;
  145. def SubstNonTypeTemplateParmExpr : StmtNode<Expr>;
  146. def SubstNonTypeTemplateParmPackExpr : StmtNode<Expr>;
  147. def FunctionParmPackExpr : StmtNode<Expr>;
  148. def MaterializeTemporaryExpr : StmtNode<Expr>;
  149. def LambdaExpr : StmtNode<Expr>;
  150. def CXXFoldExpr : StmtNode<Expr>;
  151. // C++ Coroutines TS expressions
  152. def CoroutineSuspendExpr : StmtNode<Expr, 1>;
  153. def CoawaitExpr : StmtNode<CoroutineSuspendExpr>;
  154. def DependentCoawaitExpr : StmtNode<Expr>;
  155. def CoyieldExpr : StmtNode<CoroutineSuspendExpr>;
  156. // C++20 Concepts expressions
  157. def ConceptSpecializationExpr : StmtNode<Expr>;
  158. def RequiresExpr : StmtNode<Expr>;
  159. // Obj-C Expressions.
  160. def ObjCStringLiteral : StmtNode<Expr>;
  161. def ObjCBoxedExpr : StmtNode<Expr>;
  162. def ObjCArrayLiteral : StmtNode<Expr>;
  163. def ObjCDictionaryLiteral : StmtNode<Expr>;
  164. def ObjCEncodeExpr : StmtNode<Expr>;
  165. def ObjCMessageExpr : StmtNode<Expr>;
  166. def ObjCSelectorExpr : StmtNode<Expr>;
  167. def ObjCProtocolExpr : StmtNode<Expr>;
  168. def ObjCIvarRefExpr : StmtNode<Expr>;
  169. def ObjCPropertyRefExpr : StmtNode<Expr>;
  170. def ObjCIsaExpr : StmtNode<Expr>;
  171. def ObjCIndirectCopyRestoreExpr : StmtNode<Expr>;
  172. def ObjCBoolLiteralExpr : StmtNode<Expr>;
  173. def ObjCSubscriptRefExpr : StmtNode<Expr>;
  174. def ObjCAvailabilityCheckExpr : StmtNode<Expr>;
  175. // Obj-C ARC Expressions.
  176. def ObjCBridgedCastExpr : StmtNode<ExplicitCastExpr>;
  177. // CUDA Expressions.
  178. def CUDAKernelCallExpr : StmtNode<CallExpr>;
  179. // Clang Extensions.
  180. def ShuffleVectorExpr : StmtNode<Expr>;
  181. def ConvertVectorExpr : StmtNode<Expr>;
  182. def BlockExpr : StmtNode<Expr>;
  183. def OpaqueValueExpr : StmtNode<Expr>;
  184. def TypoExpr : StmtNode<Expr>;
  185. def RecoveryExpr : StmtNode<Expr>;
  186. def BuiltinBitCastExpr : StmtNode<ExplicitCastExpr>;
  187. // Microsoft Extensions.
  188. def MSPropertyRefExpr : StmtNode<Expr>;
  189. def MSPropertySubscriptExpr : StmtNode<Expr>;
  190. def CXXUuidofExpr : StmtNode<Expr>;
  191. def SEHTryStmt : StmtNode<Stmt>;
  192. def SEHExceptStmt : StmtNode<Stmt>;
  193. def SEHFinallyStmt : StmtNode<Stmt>;
  194. def SEHLeaveStmt : StmtNode<Stmt>;
  195. def MSDependentExistsStmt : StmtNode<Stmt>;
  196. // OpenCL Extensions.
  197. def AsTypeExpr : StmtNode<Expr>;
  198. // OpenMP Directives.
  199. def OMPCanonicalLoop : StmtNode<Stmt>;
  200. def OMPExecutableDirective : StmtNode<Stmt, 1>;
  201. def OMPMetaDirective : StmtNode<OMPExecutableDirective>;
  202. def OMPLoopBasedDirective : StmtNode<OMPExecutableDirective, 1>;
  203. def OMPLoopDirective : StmtNode<OMPLoopBasedDirective, 1>;
  204. def OMPParallelDirective : StmtNode<OMPExecutableDirective>;
  205. def OMPSimdDirective : StmtNode<OMPLoopDirective>;
  206. def OMPLoopTransformationDirective : StmtNode<OMPLoopBasedDirective, 1>;
  207. def OMPTileDirective : StmtNode<OMPLoopTransformationDirective>;
  208. def OMPUnrollDirective : StmtNode<OMPLoopTransformationDirective>;
  209. def OMPForDirective : StmtNode<OMPLoopDirective>;
  210. def OMPForSimdDirective : StmtNode<OMPLoopDirective>;
  211. def OMPSectionsDirective : StmtNode<OMPExecutableDirective>;
  212. def OMPSectionDirective : StmtNode<OMPExecutableDirective>;
  213. def OMPSingleDirective : StmtNode<OMPExecutableDirective>;
  214. def OMPMasterDirective : StmtNode<OMPExecutableDirective>;
  215. def OMPCriticalDirective : StmtNode<OMPExecutableDirective>;
  216. def OMPParallelForDirective : StmtNode<OMPLoopDirective>;
  217. def OMPParallelForSimdDirective : StmtNode<OMPLoopDirective>;
  218. def OMPParallelMasterDirective : StmtNode<OMPExecutableDirective>;
  219. def OMPParallelSectionsDirective : StmtNode<OMPExecutableDirective>;
  220. def OMPTaskDirective : StmtNode<OMPExecutableDirective>;
  221. def OMPTaskyieldDirective : StmtNode<OMPExecutableDirective>;
  222. def OMPBarrierDirective : StmtNode<OMPExecutableDirective>;
  223. def OMPTaskwaitDirective : StmtNode<OMPExecutableDirective>;
  224. def OMPTaskgroupDirective : StmtNode<OMPExecutableDirective>;
  225. def OMPFlushDirective : StmtNode<OMPExecutableDirective>;
  226. def OMPDepobjDirective : StmtNode<OMPExecutableDirective>;
  227. def OMPScanDirective : StmtNode<OMPExecutableDirective>;
  228. def OMPOrderedDirective : StmtNode<OMPExecutableDirective>;
  229. def OMPAtomicDirective : StmtNode<OMPExecutableDirective>;
  230. def OMPTargetDirective : StmtNode<OMPExecutableDirective>;
  231. def OMPTargetDataDirective : StmtNode<OMPExecutableDirective>;
  232. def OMPTargetEnterDataDirective : StmtNode<OMPExecutableDirective>;
  233. def OMPTargetExitDataDirective : StmtNode<OMPExecutableDirective>;
  234. def OMPTargetParallelDirective : StmtNode<OMPExecutableDirective>;
  235. def OMPTargetParallelForDirective : StmtNode<OMPExecutableDirective>;
  236. def OMPTargetUpdateDirective : StmtNode<OMPExecutableDirective>;
  237. def OMPTeamsDirective : StmtNode<OMPExecutableDirective>;
  238. def OMPCancellationPointDirective : StmtNode<OMPExecutableDirective>;
  239. def OMPCancelDirective : StmtNode<OMPExecutableDirective>;
  240. def OMPTaskLoopDirective : StmtNode<OMPLoopDirective>;
  241. def OMPTaskLoopSimdDirective : StmtNode<OMPLoopDirective>;
  242. def OMPMasterTaskLoopDirective : StmtNode<OMPLoopDirective>;
  243. def OMPMasterTaskLoopSimdDirective : StmtNode<OMPLoopDirective>;
  244. def OMPParallelMasterTaskLoopDirective : StmtNode<OMPLoopDirective>;
  245. def OMPParallelMasterTaskLoopSimdDirective : StmtNode<OMPLoopDirective>;
  246. def OMPDistributeDirective : StmtNode<OMPLoopDirective>;
  247. def OMPDistributeParallelForDirective : StmtNode<OMPLoopDirective>;
  248. def OMPDistributeParallelForSimdDirective : StmtNode<OMPLoopDirective>;
  249. def OMPDistributeSimdDirective : StmtNode<OMPLoopDirective>;
  250. def OMPTargetParallelForSimdDirective : StmtNode<OMPLoopDirective>;
  251. def OMPTargetSimdDirective : StmtNode<OMPLoopDirective>;
  252. def OMPTeamsDistributeDirective : StmtNode<OMPLoopDirective>;
  253. def OMPTeamsDistributeSimdDirective : StmtNode<OMPLoopDirective>;
  254. def OMPTeamsDistributeParallelForSimdDirective : StmtNode<OMPLoopDirective>;
  255. def OMPTeamsDistributeParallelForDirective : StmtNode<OMPLoopDirective>;
  256. def OMPTargetTeamsDirective : StmtNode<OMPExecutableDirective>;
  257. def OMPTargetTeamsDistributeDirective : StmtNode<OMPLoopDirective>;
  258. def OMPTargetTeamsDistributeParallelForDirective : StmtNode<OMPLoopDirective>;
  259. def OMPTargetTeamsDistributeParallelForSimdDirective : StmtNode<OMPLoopDirective>;
  260. def OMPTargetTeamsDistributeSimdDirective : StmtNode<OMPLoopDirective>;
  261. def OMPInteropDirective : StmtNode<OMPExecutableDirective>;
  262. def OMPDispatchDirective : StmtNode<OMPExecutableDirective>;
  263. def OMPMaskedDirective : StmtNode<OMPExecutableDirective>;
  264. def OMPGenericLoopDirective : StmtNode<OMPLoopDirective>;