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