clang 19.0.0git
StmtObjC.h
Go to the documentation of this file.
1//===--- StmtObjC.h - Classes for representing ObjC statements --*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9/// \file
10/// Defines the Objective-C statement AST node classes.
11
12#ifndef LLVM_CLANG_AST_STMTOBJC_H
13#define LLVM_CLANG_AST_STMTOBJC_H
14
15#include "clang/AST/Stmt.h"
16#include "llvm/Support/Compiler.h"
17
18namespace clang {
19
20/// Represents Objective-C's collection statement.
21///
22/// This is represented as 'for (element 'in' collection-expression)' stmt.
24 enum { ELEM, COLLECTION, BODY, END_EXPR };
25 Stmt* SubExprs[END_EXPR]; // SubExprs[ELEM] is an expression or declstmt.
26 SourceLocation ForLoc;
27 SourceLocation RParenLoc;
28public:
29 ObjCForCollectionStmt(Stmt *Elem, Expr *Collect, Stmt *Body,
32 Stmt(ObjCForCollectionStmtClass, Empty) { }
33
34 Stmt *getElement() { return SubExprs[ELEM]; }
36 return reinterpret_cast<Expr*>(SubExprs[COLLECTION]);
37 }
38 Stmt *getBody() { return SubExprs[BODY]; }
39
40 const Stmt *getElement() const { return SubExprs[ELEM]; }
41 const Expr *getCollection() const {
42 return reinterpret_cast<Expr*>(SubExprs[COLLECTION]);
43 }
44 const Stmt *getBody() const { return SubExprs[BODY]; }
45
46 void setElement(Stmt *S) { SubExprs[ELEM] = S; }
48 SubExprs[COLLECTION] = reinterpret_cast<Stmt*>(E);
49 }
50 void setBody(Stmt *S) { SubExprs[BODY] = S; }
51
52 SourceLocation getForLoc() const { return ForLoc; }
53 void setForLoc(SourceLocation Loc) { ForLoc = Loc; }
54 SourceLocation getRParenLoc() const { return RParenLoc; }
55 void setRParenLoc(SourceLocation Loc) { RParenLoc = Loc; }
56
57 SourceLocation getBeginLoc() const LLVM_READONLY { return ForLoc; }
58 SourceLocation getEndLoc() const LLVM_READONLY {
59 return SubExprs[BODY]->getEndLoc();
60 }
61
62 static bool classof(const Stmt *T) {
63 return T->getStmtClass() == ObjCForCollectionStmtClass;
64 }
65
66 // Iterators
68 return child_range(&SubExprs[0], &SubExprs[END_EXPR]);
69 }
70
72 return const_child_range(&SubExprs[0], &SubExprs[END_EXPR]);
73 }
74};
75
76/// Represents Objective-C's \@catch statement.
77class ObjCAtCatchStmt : public Stmt {
78private:
79 VarDecl *ExceptionDecl;
80 Stmt *Body;
81 SourceLocation AtCatchLoc, RParenLoc;
82
83public:
85 VarDecl *catchVarDecl,
86 Stmt *atCatchStmt)
87 : Stmt(ObjCAtCatchStmtClass), ExceptionDecl(catchVarDecl),
88 Body(atCatchStmt), AtCatchLoc(atCatchLoc), RParenLoc(rparenloc) { }
89
90 explicit ObjCAtCatchStmt(EmptyShell Empty) :
91 Stmt(ObjCAtCatchStmtClass, Empty) { }
92
93 const Stmt *getCatchBody() const { return Body; }
94 Stmt *getCatchBody() { return Body; }
95 void setCatchBody(Stmt *S) { Body = S; }
96
97 const VarDecl *getCatchParamDecl() const {
98 return ExceptionDecl;
99 }
101 return ExceptionDecl;
102 }
103 void setCatchParamDecl(VarDecl *D) { ExceptionDecl = D; }
104
105 SourceLocation getAtCatchLoc() const { return AtCatchLoc; }
106 void setAtCatchLoc(SourceLocation Loc) { AtCatchLoc = Loc; }
107 SourceLocation getRParenLoc() const { return RParenLoc; }
108 void setRParenLoc(SourceLocation Loc) { RParenLoc = Loc; }
109
110 SourceLocation getBeginLoc() const LLVM_READONLY { return AtCatchLoc; }
111 SourceLocation getEndLoc() const LLVM_READONLY { return Body->getEndLoc(); }
112
113 bool hasEllipsis() const { return getCatchParamDecl() == nullptr; }
114
115 static bool classof(const Stmt *T) {
116 return T->getStmtClass() == ObjCAtCatchStmtClass;
117 }
118
119 child_range children() { return child_range(&Body, &Body + 1); }
120
122 return const_child_range(&Body, &Body + 1);
123 }
124};
125
126/// Represents Objective-C's \@finally statement
127class ObjCAtFinallyStmt : public Stmt {
128 SourceLocation AtFinallyLoc;
129 Stmt *AtFinallyStmt;
130
131public:
132 ObjCAtFinallyStmt(SourceLocation atFinallyLoc, Stmt *atFinallyStmt)
133 : Stmt(ObjCAtFinallyStmtClass), AtFinallyLoc(atFinallyLoc),
134 AtFinallyStmt(atFinallyStmt) {}
135
137 Stmt(ObjCAtFinallyStmtClass, Empty) { }
138
139 const Stmt *getFinallyBody() const { return AtFinallyStmt; }
140 Stmt *getFinallyBody() { return AtFinallyStmt; }
141 void setFinallyBody(Stmt *S) { AtFinallyStmt = S; }
142
143 SourceLocation getBeginLoc() const LLVM_READONLY { return AtFinallyLoc; }
144 SourceLocation getEndLoc() const LLVM_READONLY {
145 return AtFinallyStmt->getEndLoc();
146 }
147
148 SourceLocation getAtFinallyLoc() const { return AtFinallyLoc; }
149 void setAtFinallyLoc(SourceLocation Loc) { AtFinallyLoc = Loc; }
150
151 static bool classof(const Stmt *T) {
152 return T->getStmtClass() == ObjCAtFinallyStmtClass;
153 }
154
156 return child_range(&AtFinallyStmt, &AtFinallyStmt+1);
157 }
158
160 return const_child_range(&AtFinallyStmt, &AtFinallyStmt + 1);
161 }
162};
163
164/// Represents Objective-C's \@try ... \@catch ... \@finally statement.
165class ObjCAtTryStmt final
166 : public Stmt,
167 private llvm::TrailingObjects<ObjCAtTryStmt, Stmt *> {
168 friend TrailingObjects;
169 size_t numTrailingObjects(OverloadToken<Stmt *>) const {
170 return 1 + NumCatchStmts + HasFinally;
171 }
172
173 // The location of the @ in the \@try.
174 SourceLocation AtTryLoc;
175
176 // The number of catch blocks in this statement.
177 unsigned NumCatchStmts : 16;
178
179 // Whether this statement has a \@finally statement.
180 LLVM_PREFERRED_TYPE(bool)
181 unsigned HasFinally : 1;
182
183 /// Retrieve the statements that are stored after this \@try statement.
184 ///
185 /// The order of the statements in memory follows the order in the source,
186 /// with the \@try body first, followed by the \@catch statements (if any)
187 /// and, finally, the \@finally (if it exists).
188 Stmt **getStmts() { return getTrailingObjects<Stmt *>(); }
189 Stmt *const *getStmts() const { return getTrailingObjects<Stmt *>(); }
190
191 ObjCAtTryStmt(SourceLocation atTryLoc, Stmt *atTryStmt,
192 Stmt **CatchStmts, unsigned NumCatchStmts,
193 Stmt *atFinallyStmt);
194
195 explicit ObjCAtTryStmt(EmptyShell Empty, unsigned NumCatchStmts,
196 bool HasFinally)
197 : Stmt(ObjCAtTryStmtClass, Empty), NumCatchStmts(NumCatchStmts),
198 HasFinally(HasFinally) { }
199
200public:
201 static ObjCAtTryStmt *Create(const ASTContext &Context,
202 SourceLocation atTryLoc, Stmt *atTryStmt,
203 Stmt **CatchStmts, unsigned NumCatchStmts,
204 Stmt *atFinallyStmt);
205 static ObjCAtTryStmt *CreateEmpty(const ASTContext &Context,
206 unsigned NumCatchStmts, bool HasFinally);
207
208 /// Retrieve the location of the @ in the \@try.
209 SourceLocation getAtTryLoc() const { return AtTryLoc; }
210 void setAtTryLoc(SourceLocation Loc) { AtTryLoc = Loc; }
211
212 /// Retrieve the \@try body.
213 const Stmt *getTryBody() const { return getStmts()[0]; }
214 Stmt *getTryBody() { return getStmts()[0]; }
215 void setTryBody(Stmt *S) { getStmts()[0] = S; }
216
217 /// Retrieve the number of \@catch statements in this try-catch-finally
218 /// block.
219 unsigned getNumCatchStmts() const { return NumCatchStmts; }
220
221 /// Retrieve a \@catch statement.
222 const ObjCAtCatchStmt *getCatchStmt(unsigned I) const {
223 assert(I < NumCatchStmts && "Out-of-bounds @catch index");
224 return cast_or_null<ObjCAtCatchStmt>(getStmts()[I + 1]);
225 }
226
227 /// Retrieve a \@catch statement.
229 assert(I < NumCatchStmts && "Out-of-bounds @catch index");
230 return cast_or_null<ObjCAtCatchStmt>(getStmts()[I + 1]);
231 }
232
233 /// Set a particular catch statement.
234 void setCatchStmt(unsigned I, ObjCAtCatchStmt *S) {
235 assert(I < NumCatchStmts && "Out-of-bounds @catch index");
236 getStmts()[I + 1] = S;
237 }
238
239 /// Retrieve the \@finally statement, if any.
241 if (!HasFinally)
242 return nullptr;
243
244 return cast_or_null<ObjCAtFinallyStmt>(getStmts()[1 + NumCatchStmts]);
245 }
247 if (!HasFinally)
248 return nullptr;
249
250 return cast_or_null<ObjCAtFinallyStmt>(getStmts()[1 + NumCatchStmts]);
251 }
253 assert(HasFinally && "@try does not have a @finally slot!");
254 getStmts()[1 + NumCatchStmts] = S;
255 }
256
257 SourceLocation getBeginLoc() const LLVM_READONLY { return AtTryLoc; }
258 SourceLocation getEndLoc() const LLVM_READONLY;
259
260 static bool classof(const Stmt *T) {
261 return T->getStmtClass() == ObjCAtTryStmtClass;
262 }
263
265 return child_range(
266 getStmts(), getStmts() + numTrailingObjects(OverloadToken<Stmt *>()));
267 }
268
270 return const_child_range(const_cast<ObjCAtTryStmt *>(this)->children());
271 }
272
275 using catch_range = llvm::iterator_range<catch_stmt_iterator>;
276 using catch_const_range = llvm::iterator_range<const_catch_stmt_iterator>;
277
278 catch_stmt_iterator catch_stmts_begin() { return getStmts() + 1; }
280 return catch_stmts_begin() + NumCatchStmts;
281 }
284 }
285
286 const_catch_stmt_iterator catch_stmts_begin() const { return getStmts() + 1; }
288 return catch_stmts_begin() + NumCatchStmts;
289 }
292 }
293};
294
295/// Represents Objective-C's \@synchronized statement.
296///
297/// Example:
298/// \code
299/// @synchronized (sem) {
300/// do-something;
301/// }
302/// \endcode
304private:
305 SourceLocation AtSynchronizedLoc;
306 enum { SYNC_EXPR, SYNC_BODY, END_EXPR };
307 Stmt* SubStmts[END_EXPR];
308
309public:
310 ObjCAtSynchronizedStmt(SourceLocation atSynchronizedLoc, Stmt *synchExpr,
311 Stmt *synchBody)
312 : Stmt(ObjCAtSynchronizedStmtClass) {
313 SubStmts[SYNC_EXPR] = synchExpr;
314 SubStmts[SYNC_BODY] = synchBody;
315 AtSynchronizedLoc = atSynchronizedLoc;
316 }
318 Stmt(ObjCAtSynchronizedStmtClass, Empty) { }
319
320 SourceLocation getAtSynchronizedLoc() const { return AtSynchronizedLoc; }
321 void setAtSynchronizedLoc(SourceLocation Loc) { AtSynchronizedLoc = Loc; }
322
323 const CompoundStmt *getSynchBody() const {
324 return reinterpret_cast<CompoundStmt*>(SubStmts[SYNC_BODY]);
325 }
327 return reinterpret_cast<CompoundStmt*>(SubStmts[SYNC_BODY]);
328 }
329 void setSynchBody(Stmt *S) { SubStmts[SYNC_BODY] = S; }
330
331 const Expr *getSynchExpr() const {
332 return reinterpret_cast<Expr*>(SubStmts[SYNC_EXPR]);
333 }
335 return reinterpret_cast<Expr*>(SubStmts[SYNC_EXPR]);
336 }
337 void setSynchExpr(Stmt *S) { SubStmts[SYNC_EXPR] = S; }
338
339 SourceLocation getBeginLoc() const LLVM_READONLY { return AtSynchronizedLoc; }
340 SourceLocation getEndLoc() const LLVM_READONLY {
341 return getSynchBody()->getEndLoc();
342 }
343
344 static bool classof(const Stmt *T) {
345 return T->getStmtClass() == ObjCAtSynchronizedStmtClass;
346 }
347
349 return child_range(&SubStmts[0], &SubStmts[0]+END_EXPR);
350 }
351
353 return const_child_range(&SubStmts[0], &SubStmts[0] + END_EXPR);
354 }
355};
356
357/// Represents Objective-C's \@throw statement.
358class ObjCAtThrowStmt : public Stmt {
359 SourceLocation AtThrowLoc;
360 Stmt *Throw;
361
362public:
363 ObjCAtThrowStmt(SourceLocation atThrowLoc, Stmt *throwExpr)
364 : Stmt(ObjCAtThrowStmtClass), Throw(throwExpr) {
365 AtThrowLoc = atThrowLoc;
366 }
367 explicit ObjCAtThrowStmt(EmptyShell Empty) :
368 Stmt(ObjCAtThrowStmtClass, Empty) { }
369
370 const Expr *getThrowExpr() const { return reinterpret_cast<Expr*>(Throw); }
371 Expr *getThrowExpr() { return reinterpret_cast<Expr*>(Throw); }
372 void setThrowExpr(Stmt *S) { Throw = S; }
373
374 SourceLocation getThrowLoc() const LLVM_READONLY { return AtThrowLoc; }
375 void setThrowLoc(SourceLocation Loc) { AtThrowLoc = Loc; }
376
377 SourceLocation getBeginLoc() const LLVM_READONLY { return AtThrowLoc; }
378 SourceLocation getEndLoc() const LLVM_READONLY {
379 return Throw ? Throw->getEndLoc() : AtThrowLoc;
380 }
381
382 static bool classof(const Stmt *T) {
383 return T->getStmtClass() == ObjCAtThrowStmtClass;
384 }
385
386 child_range children() { return child_range(&Throw, &Throw+1); }
387
389 return const_child_range(&Throw, &Throw + 1);
390 }
391};
392
393/// Represents Objective-C's \@autoreleasepool Statement
395 SourceLocation AtLoc;
396 Stmt *SubStmt;
397
398public:
400 : Stmt(ObjCAutoreleasePoolStmtClass), AtLoc(atLoc), SubStmt(subStmt) {}
401
403 Stmt(ObjCAutoreleasePoolStmtClass, Empty) { }
404
405 const Stmt *getSubStmt() const { return SubStmt; }
406 Stmt *getSubStmt() { return SubStmt; }
407 void setSubStmt(Stmt *S) { SubStmt = S; }
408
409 SourceLocation getBeginLoc() const LLVM_READONLY { return AtLoc; }
410 SourceLocation getEndLoc() const LLVM_READONLY {
411 return SubStmt->getEndLoc();
412 }
413
414 SourceLocation getAtLoc() const { return AtLoc; }
415 void setAtLoc(SourceLocation Loc) { AtLoc = Loc; }
416
417 static bool classof(const Stmt *T) {
418 return T->getStmtClass() == ObjCAutoreleasePoolStmtClass;
419 }
420
421 child_range children() { return child_range(&SubStmt, &SubStmt + 1); }
422
424 return const_child_range(&SubStmt, &SubStmt + 1);
425 }
426};
427
428} // end namespace clang
429
430#endif
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Definition: ASTContext.h:182
CompoundStmt - This represents a group of statements like { stmt stmt }.
Definition: Stmt.h:1604
SourceLocation getEndLoc() const
Definition: Stmt.h:1734
This represents one expression.
Definition: Expr.h:110
Represents Objective-C's @catch statement.
Definition: StmtObjC.h:77
const VarDecl * getCatchParamDecl() const
Definition: StmtObjC.h:97
bool hasEllipsis() const
Definition: StmtObjC.h:113
const_child_range children() const
Definition: StmtObjC.h:121
child_range children()
Definition: StmtObjC.h:119
const Stmt * getCatchBody() const
Definition: StmtObjC.h:93
SourceLocation getEndLoc() const LLVM_READONLY
Definition: StmtObjC.h:111
ObjCAtCatchStmt(EmptyShell Empty)
Definition: StmtObjC.h:90
void setCatchParamDecl(VarDecl *D)
Definition: StmtObjC.h:103
Stmt * getCatchBody()
Definition: StmtObjC.h:94
void setCatchBody(Stmt *S)
Definition: StmtObjC.h:95
static bool classof(const Stmt *T)
Definition: StmtObjC.h:115
void setRParenLoc(SourceLocation Loc)
Definition: StmtObjC.h:108
SourceLocation getAtCatchLoc() const
Definition: StmtObjC.h:105
VarDecl * getCatchParamDecl()
Definition: StmtObjC.h:100
ObjCAtCatchStmt(SourceLocation atCatchLoc, SourceLocation rparenloc, VarDecl *catchVarDecl, Stmt *atCatchStmt)
Definition: StmtObjC.h:84
SourceLocation getBeginLoc() const LLVM_READONLY
Definition: StmtObjC.h:110
void setAtCatchLoc(SourceLocation Loc)
Definition: StmtObjC.h:106
SourceLocation getRParenLoc() const
Definition: StmtObjC.h:107
Represents Objective-C's @finally statement.
Definition: StmtObjC.h:127
const Stmt * getFinallyBody() const
Definition: StmtObjC.h:139
void setFinallyBody(Stmt *S)
Definition: StmtObjC.h:141
SourceLocation getBeginLoc() const LLVM_READONLY
Definition: StmtObjC.h:143
ObjCAtFinallyStmt(SourceLocation atFinallyLoc, Stmt *atFinallyStmt)
Definition: StmtObjC.h:132
static bool classof(const Stmt *T)
Definition: StmtObjC.h:151
void setAtFinallyLoc(SourceLocation Loc)
Definition: StmtObjC.h:149
ObjCAtFinallyStmt(EmptyShell Empty)
Definition: StmtObjC.h:136
SourceLocation getAtFinallyLoc() const
Definition: StmtObjC.h:148
const_child_range children() const
Definition: StmtObjC.h:159
child_range children()
Definition: StmtObjC.h:155
SourceLocation getEndLoc() const LLVM_READONLY
Definition: StmtObjC.h:144
Represents Objective-C's @synchronized statement.
Definition: StmtObjC.h:303
const Expr * getSynchExpr() const
Definition: StmtObjC.h:331
CompoundStmt * getSynchBody()
Definition: StmtObjC.h:326
ObjCAtSynchronizedStmt(SourceLocation atSynchronizedLoc, Stmt *synchExpr, Stmt *synchBody)
Definition: StmtObjC.h:310
void setSynchBody(Stmt *S)
Definition: StmtObjC.h:329
const CompoundStmt * getSynchBody() const
Definition: StmtObjC.h:323
void setAtSynchronizedLoc(SourceLocation Loc)
Definition: StmtObjC.h:321
SourceLocation getAtSynchronizedLoc() const
Definition: StmtObjC.h:320
const_child_range children() const
Definition: StmtObjC.h:352
SourceLocation getBeginLoc() const LLVM_READONLY
Definition: StmtObjC.h:339
ObjCAtSynchronizedStmt(EmptyShell Empty)
Definition: StmtObjC.h:317
void setSynchExpr(Stmt *S)
Definition: StmtObjC.h:337
static bool classof(const Stmt *T)
Definition: StmtObjC.h:344
SourceLocation getEndLoc() const LLVM_READONLY
Definition: StmtObjC.h:340
Represents Objective-C's @throw statement.
Definition: StmtObjC.h:358
const Expr * getThrowExpr() const
Definition: StmtObjC.h:370
void setThrowLoc(SourceLocation Loc)
Definition: StmtObjC.h:375
child_range children()
Definition: StmtObjC.h:386
static bool classof(const Stmt *T)
Definition: StmtObjC.h:382
ObjCAtThrowStmt(SourceLocation atThrowLoc, Stmt *throwExpr)
Definition: StmtObjC.h:363
const_child_range children() const
Definition: StmtObjC.h:388
SourceLocation getThrowLoc() const LLVM_READONLY
Definition: StmtObjC.h:374
void setThrowExpr(Stmt *S)
Definition: StmtObjC.h:372
SourceLocation getBeginLoc() const LLVM_READONLY
Definition: StmtObjC.h:377
ObjCAtThrowStmt(EmptyShell Empty)
Definition: StmtObjC.h:367
SourceLocation getEndLoc() const LLVM_READONLY
Definition: StmtObjC.h:378
Represents Objective-C's @try ... @catch ... @finally statement.
Definition: StmtObjC.h:167
void setAtTryLoc(SourceLocation Loc)
Definition: StmtObjC.h:210
llvm::iterator_range< const_catch_stmt_iterator > catch_const_range
Definition: StmtObjC.h:276
const ObjCAtFinallyStmt * getFinallyStmt() const
Retrieve the @finally statement, if any.
Definition: StmtObjC.h:240
void setFinallyStmt(Stmt *S)
Definition: StmtObjC.h:252
catch_stmt_iterator catch_stmts_end()
Definition: StmtObjC.h:279
const_child_range children() const
Definition: StmtObjC.h:269
static ObjCAtTryStmt * CreateEmpty(const ASTContext &Context, unsigned NumCatchStmts, bool HasFinally)
Definition: StmtObjC.cpp:56
llvm::iterator_range< catch_stmt_iterator > catch_range
Definition: StmtObjC.h:275
unsigned getNumCatchStmts() const
Retrieve the number of @catch statements in this try-catch-finally block.
Definition: StmtObjC.h:219
catch_stmt_iterator catch_stmts_begin()
Definition: StmtObjC.h:278
Stmt * getTryBody()
Definition: StmtObjC.h:214
ObjCAtFinallyStmt * getFinallyStmt()
Definition: StmtObjC.h:246
SourceLocation getBeginLoc() const LLVM_READONLY
Definition: StmtObjC.h:257
void setCatchStmt(unsigned I, ObjCAtCatchStmt *S)
Set a particular catch statement.
Definition: StmtObjC.h:234
static bool classof(const Stmt *T)
Definition: StmtObjC.h:260
child_range children()
Definition: StmtObjC.h:264
const ObjCAtCatchStmt * getCatchStmt(unsigned I) const
Retrieve a @catch statement.
Definition: StmtObjC.h:222
void setTryBody(Stmt *S)
Definition: StmtObjC.h:215
const Stmt * getTryBody() const
Retrieve the @try body.
Definition: StmtObjC.h:213
catch_const_range catch_stmts() const
Definition: StmtObjC.h:290
SourceLocation getEndLoc() const LLVM_READONLY
Definition: StmtObjC.cpp:64
const_catch_stmt_iterator catch_stmts_begin() const
Definition: StmtObjC.h:286
SourceLocation getAtTryLoc() const
Retrieve the location of the @ in the @try.
Definition: StmtObjC.h:209
const_catch_stmt_iterator catch_stmts_end() const
Definition: StmtObjC.h:287
ObjCAtCatchStmt * getCatchStmt(unsigned I)
Retrieve a @catch statement.
Definition: StmtObjC.h:228
catch_range catch_stmts()
Definition: StmtObjC.h:282
Represents Objective-C's @autoreleasepool Statement.
Definition: StmtObjC.h:394
void setAtLoc(SourceLocation Loc)
Definition: StmtObjC.h:415
const_child_range children() const
Definition: StmtObjC.h:423
ObjCAutoreleasePoolStmt(EmptyShell Empty)
Definition: StmtObjC.h:402
SourceLocation getAtLoc() const
Definition: StmtObjC.h:414
static bool classof(const Stmt *T)
Definition: StmtObjC.h:417
SourceLocation getBeginLoc() const LLVM_READONLY
Definition: StmtObjC.h:409
ObjCAutoreleasePoolStmt(SourceLocation atLoc, Stmt *subStmt)
Definition: StmtObjC.h:399
const Stmt * getSubStmt() const
Definition: StmtObjC.h:405
SourceLocation getEndLoc() const LLVM_READONLY
Definition: StmtObjC.h:410
Represents Objective-C's collection statement.
Definition: StmtObjC.h:23
ObjCForCollectionStmt(EmptyShell Empty)
Definition: StmtObjC.h:31
const Stmt * getElement() const
Definition: StmtObjC.h:40
void setCollection(Expr *E)
Definition: StmtObjC.h:47
void setForLoc(SourceLocation Loc)
Definition: StmtObjC.h:53
SourceLocation getForLoc() const
Definition: StmtObjC.h:52
const_child_range children() const
Definition: StmtObjC.h:71
static bool classof(const Stmt *T)
Definition: StmtObjC.h:62
child_range children()
Definition: StmtObjC.h:67
void setRParenLoc(SourceLocation Loc)
Definition: StmtObjC.h:55
SourceLocation getEndLoc() const LLVM_READONLY
Definition: StmtObjC.h:58
SourceLocation getRParenLoc() const
Definition: StmtObjC.h:54
const Expr * getCollection() const
Definition: StmtObjC.h:41
const Stmt * getBody() const
Definition: StmtObjC.h:44
SourceLocation getBeginLoc() const LLVM_READONLY
Definition: StmtObjC.h:57
void setElement(Stmt *S)
Definition: StmtObjC.h:46
Encodes a location in the source.
Stmt - This represents one statement.
Definition: Stmt.h:84
SourceLocation getEndLoc() const LLVM_READONLY
Definition: Stmt.cpp:350
StmtClass getStmtClass() const
Definition: Stmt.h:1356
llvm::iterator_range< child_iterator > child_range
Definition: Stmt.h:1445
Stmt()=delete
llvm::iterator_range< const_child_iterator > const_child_range
Definition: Stmt.h:1446
Represents a variable declaration or definition.
Definition: Decl.h:918
The JSON file list parser is used to communicate input to InstallAPI.
@ Create
'copyin' clause, allowed on Compute and Combined constructs, plus 'data', 'enter data',...
Iterator for iterating over Stmt * arrays that contain only T *.
Definition: Stmt.h:1314
A placeholder type used to construct an empty shell of a type, that will be filled in later (e....
Definition: Stmt.h:1296