clang  10.0.0svn
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 
18 namespace clang {
19 
20 /// Represents Objective-C's collection statement.
21 ///
22 /// This is represented as 'for (element 'in' collection-expression)' stmt.
23 class ObjCForCollectionStmt : public 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;
28 public:
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; }
47  void setCollection(Expr *E) {
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.
77 class ObjCAtCatchStmt : public Stmt {
78 private:
79  VarDecl *ExceptionDecl;
80  Stmt *Body;
81  SourceLocation AtCatchLoc, RParenLoc;
82 
83 public:
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
127 class ObjCAtFinallyStmt : public Stmt {
128  SourceLocation AtFinallyLoc;
129  Stmt *AtFinallyStmt;
130 
131 public:
132  ObjCAtFinallyStmt(SourceLocation atFinallyLoc, Stmt *atFinallyStmt)
133  : Stmt(ObjCAtFinallyStmtClass), AtFinallyLoc(atFinallyLoc),
134  AtFinallyStmt(atFinallyStmt) {}
135 
136  explicit ObjCAtFinallyStmt(EmptyShell Empty) :
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.
165 class ObjCAtTryStmt : public Stmt {
166 private:
167  // The location of the @ in the \@try.
168  SourceLocation AtTryLoc;
169 
170  // The number of catch blocks in this statement.
171  unsigned NumCatchStmts : 16;
172 
173  // Whether this statement has a \@finally statement.
174  bool HasFinally : 1;
175 
176  /// Retrieve the statements that are stored after this \@try statement.
177  ///
178  /// The order of the statements in memory follows the order in the source,
179  /// with the \@try body first, followed by the \@catch statements (if any)
180  /// and, finally, the \@finally (if it exists).
181  Stmt **getStmts() { return reinterpret_cast<Stmt **> (this + 1); }
182  const Stmt* const *getStmts() const {
183  return reinterpret_cast<const Stmt * const*> (this + 1);
184  }
185 
186  ObjCAtTryStmt(SourceLocation atTryLoc, Stmt *atTryStmt,
187  Stmt **CatchStmts, unsigned NumCatchStmts,
188  Stmt *atFinallyStmt);
189 
190  explicit ObjCAtTryStmt(EmptyShell Empty, unsigned NumCatchStmts,
191  bool HasFinally)
192  : Stmt(ObjCAtTryStmtClass, Empty), NumCatchStmts(NumCatchStmts),
193  HasFinally(HasFinally) { }
194 
195 public:
196  static ObjCAtTryStmt *Create(const ASTContext &Context,
197  SourceLocation atTryLoc, Stmt *atTryStmt,
198  Stmt **CatchStmts, unsigned NumCatchStmts,
199  Stmt *atFinallyStmt);
200  static ObjCAtTryStmt *CreateEmpty(const ASTContext &Context,
201  unsigned NumCatchStmts, bool HasFinally);
202 
203  /// Retrieve the location of the @ in the \@try.
204  SourceLocation getAtTryLoc() const { return AtTryLoc; }
205  void setAtTryLoc(SourceLocation Loc) { AtTryLoc = Loc; }
206 
207  /// Retrieve the \@try body.
208  const Stmt *getTryBody() const { return getStmts()[0]; }
209  Stmt *getTryBody() { return getStmts()[0]; }
210  void setTryBody(Stmt *S) { getStmts()[0] = S; }
211 
212  /// Retrieve the number of \@catch statements in this try-catch-finally
213  /// block.
214  unsigned getNumCatchStmts() const { return NumCatchStmts; }
215 
216  /// Retrieve a \@catch statement.
217  const ObjCAtCatchStmt *getCatchStmt(unsigned I) const {
218  assert(I < NumCatchStmts && "Out-of-bounds @catch index");
219  return cast_or_null<ObjCAtCatchStmt>(getStmts()[I + 1]);
220  }
221 
222  /// Retrieve a \@catch statement.
224  assert(I < NumCatchStmts && "Out-of-bounds @catch index");
225  return cast_or_null<ObjCAtCatchStmt>(getStmts()[I + 1]);
226  }
227 
228  /// Set a particular catch statement.
229  void setCatchStmt(unsigned I, ObjCAtCatchStmt *S) {
230  assert(I < NumCatchStmts && "Out-of-bounds @catch index");
231  getStmts()[I + 1] = S;
232  }
233 
234  /// Retrieve the \@finally statement, if any.
236  if (!HasFinally)
237  return nullptr;
238 
239  return cast_or_null<ObjCAtFinallyStmt>(getStmts()[1 + NumCatchStmts]);
240  }
242  if (!HasFinally)
243  return nullptr;
244 
245  return cast_or_null<ObjCAtFinallyStmt>(getStmts()[1 + NumCatchStmts]);
246  }
247  void setFinallyStmt(Stmt *S) {
248  assert(HasFinally && "@try does not have a @finally slot!");
249  getStmts()[1 + NumCatchStmts] = S;
250  }
251 
252  SourceLocation getBeginLoc() const LLVM_READONLY { return AtTryLoc; }
253  SourceLocation getEndLoc() const LLVM_READONLY;
254 
255  static bool classof(const Stmt *T) {
256  return T->getStmtClass() == ObjCAtTryStmtClass;
257  }
258 
260  return child_range(getStmts(),
261  getStmts() + 1 + NumCatchStmts + HasFinally);
262  }
263 
265  return const_child_range(const_cast<ObjCAtTryStmt *>(this)->children());
266  }
267 };
268 
269 /// Represents Objective-C's \@synchronized statement.
270 ///
271 /// Example:
272 /// \code
273 /// @synchronized (sem) {
274 /// do-something;
275 /// }
276 /// \endcode
277 class ObjCAtSynchronizedStmt : public Stmt {
278 private:
279  SourceLocation AtSynchronizedLoc;
280  enum { SYNC_EXPR, SYNC_BODY, END_EXPR };
281  Stmt* SubStmts[END_EXPR];
282 
283 public:
284  ObjCAtSynchronizedStmt(SourceLocation atSynchronizedLoc, Stmt *synchExpr,
285  Stmt *synchBody)
286  : Stmt(ObjCAtSynchronizedStmtClass) {
287  SubStmts[SYNC_EXPR] = synchExpr;
288  SubStmts[SYNC_BODY] = synchBody;
289  AtSynchronizedLoc = atSynchronizedLoc;
290  }
292  Stmt(ObjCAtSynchronizedStmtClass, Empty) { }
293 
294  SourceLocation getAtSynchronizedLoc() const { return AtSynchronizedLoc; }
295  void setAtSynchronizedLoc(SourceLocation Loc) { AtSynchronizedLoc = Loc; }
296 
297  const CompoundStmt *getSynchBody() const {
298  return reinterpret_cast<CompoundStmt*>(SubStmts[SYNC_BODY]);
299  }
301  return reinterpret_cast<CompoundStmt*>(SubStmts[SYNC_BODY]);
302  }
303  void setSynchBody(Stmt *S) { SubStmts[SYNC_BODY] = S; }
304 
305  const Expr *getSynchExpr() const {
306  return reinterpret_cast<Expr*>(SubStmts[SYNC_EXPR]);
307  }
309  return reinterpret_cast<Expr*>(SubStmts[SYNC_EXPR]);
310  }
311  void setSynchExpr(Stmt *S) { SubStmts[SYNC_EXPR] = S; }
312 
313  SourceLocation getBeginLoc() const LLVM_READONLY { return AtSynchronizedLoc; }
314  SourceLocation getEndLoc() const LLVM_READONLY {
315  return getSynchBody()->getEndLoc();
316  }
317 
318  static bool classof(const Stmt *T) {
319  return T->getStmtClass() == ObjCAtSynchronizedStmtClass;
320  }
321 
323  return child_range(&SubStmts[0], &SubStmts[0]+END_EXPR);
324  }
325 
327  return const_child_range(&SubStmts[0], &SubStmts[0] + END_EXPR);
328  }
329 };
330 
331 /// Represents Objective-C's \@throw statement.
332 class ObjCAtThrowStmt : public Stmt {
333  SourceLocation AtThrowLoc;
334  Stmt *Throw;
335 
336 public:
337  ObjCAtThrowStmt(SourceLocation atThrowLoc, Stmt *throwExpr)
338  : Stmt(ObjCAtThrowStmtClass), Throw(throwExpr) {
339  AtThrowLoc = atThrowLoc;
340  }
341  explicit ObjCAtThrowStmt(EmptyShell Empty) :
342  Stmt(ObjCAtThrowStmtClass, Empty) { }
343 
344  const Expr *getThrowExpr() const { return reinterpret_cast<Expr*>(Throw); }
345  Expr *getThrowExpr() { return reinterpret_cast<Expr*>(Throw); }
346  void setThrowExpr(Stmt *S) { Throw = S; }
347 
348  SourceLocation getThrowLoc() const LLVM_READONLY { return AtThrowLoc; }
349  void setThrowLoc(SourceLocation Loc) { AtThrowLoc = Loc; }
350 
351  SourceLocation getBeginLoc() const LLVM_READONLY { return AtThrowLoc; }
352  SourceLocation getEndLoc() const LLVM_READONLY {
353  return Throw ? Throw->getEndLoc() : AtThrowLoc;
354  }
355 
356  static bool classof(const Stmt *T) {
357  return T->getStmtClass() == ObjCAtThrowStmtClass;
358  }
359 
360  child_range children() { return child_range(&Throw, &Throw+1); }
361 
363  return const_child_range(&Throw, &Throw + 1);
364  }
365 };
366 
367 /// Represents Objective-C's \@autoreleasepool Statement
369  SourceLocation AtLoc;
370  Stmt *SubStmt;
371 
372 public:
374  : Stmt(ObjCAutoreleasePoolStmtClass), AtLoc(atLoc), SubStmt(subStmt) {}
375 
377  Stmt(ObjCAutoreleasePoolStmtClass, Empty) { }
378 
379  const Stmt *getSubStmt() const { return SubStmt; }
380  Stmt *getSubStmt() { return SubStmt; }
381  void setSubStmt(Stmt *S) { SubStmt = S; }
382 
383  SourceLocation getBeginLoc() const LLVM_READONLY { return AtLoc; }
384  SourceLocation getEndLoc() const LLVM_READONLY {
385  return SubStmt->getEndLoc();
386  }
387 
388  SourceLocation getAtLoc() const { return AtLoc; }
389  void setAtLoc(SourceLocation Loc) { AtLoc = Loc; }
390 
391  static bool classof(const Stmt *T) {
392  return T->getStmtClass() == ObjCAutoreleasePoolStmtClass;
393  }
394 
395  child_range children() { return child_range(&SubStmt, &SubStmt + 1); }
396 
398  return const_child_range(&SubStmt, &SubStmt + 1);
399  }
400 };
401 
402 } // end namespace clang
403 
404 #endif
static bool classof(const Stmt *T)
Definition: StmtObjC.h:255
ObjCAtSynchronizedStmt(SourceLocation atSynchronizedLoc, Stmt *synchExpr, Stmt *synchBody)
Definition: StmtObjC.h:284
VarDecl * getCatchParamDecl()
Definition: StmtObjC.h:100
ObjCForCollectionStmt(EmptyShell Empty)
Definition: StmtObjC.h:31
SourceLocation getRParenLoc() const
Definition: StmtObjC.h:107
ObjCAutoreleasePoolStmt(EmptyShell Empty)
Definition: StmtObjC.h:376
Stmt - This represents one statement.
Definition: Stmt.h:66
const ObjCAtFinallyStmt * getFinallyStmt() const
Retrieve the @finally statement, if any.
Definition: StmtObjC.h:235
ObjCAtCatchStmt(EmptyShell Empty)
Definition: StmtObjC.h:90
SourceLocation getEndLoc() const LLVM_READONLY
Definition: StmtObjC.h:352
void setThrowExpr(Stmt *S)
Definition: StmtObjC.h:346
Represents Objective-C&#39;s @throw statement.
Definition: StmtObjC.h:332
llvm::iterator_range< child_iterator > child_range
Definition: Stmt.h:1158
const_child_range children() const
Definition: StmtObjC.h:159
static bool classof(const Stmt *T)
Definition: StmtObjC.h:391
Represents a variable declaration or definition.
Definition: Decl.h:812
const Stmt * getSubStmt() const
Definition: StmtObjC.h:379
static bool classof(const Stmt *T)
Definition: StmtObjC.h:115
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Definition: ASTContext.h:154
SourceLocation getEndLoc() const LLVM_READONLY
Definition: StmtObjC.h:111
const Stmt * getElement() const
Definition: StmtObjC.h:40
SourceLocation getEndLoc() const LLVM_READONLY
Definition: StmtObjC.h:384
Represents Objective-C&#39;s @catch statement.
Definition: StmtObjC.h:77
SourceLocation getEndLoc() const LLVM_READONLY
Definition: StmtObjC.h:144
const_child_range children() const
Definition: StmtObjC.h:397
static bool classof(const Stmt *T)
Definition: StmtObjC.h:356
const Expr * getThrowExpr() const
Definition: StmtObjC.h:344
void setSynchBody(Stmt *S)
Definition: StmtObjC.h:303
static bool classof(const Stmt *T)
Definition: StmtObjC.h:151
ObjCAtSynchronizedStmt(EmptyShell Empty)
Definition: StmtObjC.h:291
ObjCAtFinallyStmt * getFinallyStmt()
Definition: StmtObjC.h:241
SourceLocation getBeginLoc() const LLVM_READONLY
Definition: StmtObjC.h:252
const_child_range children() const
Definition: StmtObjC.h:71
const Stmt * getBody() const
Definition: StmtObjC.h:44
void setRParenLoc(SourceLocation Loc)
Definition: StmtObjC.h:55
ObjCAtCatchStmt(SourceLocation atCatchLoc, SourceLocation rparenloc, VarDecl *catchVarDecl, Stmt *atCatchStmt)
Definition: StmtObjC.h:84
Stmt * getTryBody()
Definition: StmtObjC.h:209
const ObjCAtCatchStmt * getCatchStmt(unsigned I) const
Retrieve a @catch statement.
Definition: StmtObjC.h:217
const Expr * getCollection() const
Definition: StmtObjC.h:41
llvm::iterator_range< const_child_iterator > const_child_range
Definition: Stmt.h:1159
CompoundStmt - This represents a group of statements like { stmt stmt }.
Definition: Stmt.h:1310
CompoundStmt * getSynchBody()
Definition: StmtObjC.h:300
SourceLocation getThrowLoc() const LLVM_READONLY
Definition: StmtObjC.h:348
ObjCAtFinallyStmt(SourceLocation atFinallyLoc, Stmt *atFinallyStmt)
Definition: StmtObjC.h:132
void setRParenLoc(SourceLocation Loc)
Definition: StmtObjC.h:108
This represents one expression.
Definition: Expr.h:108
ObjCAtThrowStmt(SourceLocation atThrowLoc, Stmt *throwExpr)
Definition: StmtObjC.h:337
ObjCForCollectionStmt(Stmt *Elem, Expr *Collect, Stmt *Body, SourceLocation FCL, SourceLocation RPL)
Definition: StmtObjC.cpp:20
ObjCAtCatchStmt * getCatchStmt(unsigned I)
Retrieve a @catch statement.
Definition: StmtObjC.h:223
const CompoundStmt * getSynchBody() const
Definition: StmtObjC.h:297
Represents Objective-C&#39;s @synchronized statement.
Definition: StmtObjC.h:277
void setFinallyBody(Stmt *S)
Definition: StmtObjC.h:141
SourceLocation getAtTryLoc() const
Retrieve the location of the @ in the @try.
Definition: StmtObjC.h:204
SourceLocation getBeginLoc() const LLVM_READONLY
Definition: StmtObjC.h:57
child_range children()
Definition: StmtObjC.h:67
Stmt * getCatchBody()
Definition: StmtObjC.h:94
void setFinallyStmt(Stmt *S)
Definition: StmtObjC.h:247
Stmt()=delete
static OMPLinearClause * CreateEmpty(const ASTContext &C, unsigned NumVars)
Creates an empty clause with the place for NumVars variables.
SourceLocation getEndLoc() const LLVM_READONLY
Definition: StmtObjC.h:58
const Stmt * getTryBody() const
Retrieve the @try body.
Definition: StmtObjC.h:208
SourceLocation getAtLoc() const
Definition: StmtObjC.h:388
static bool classof(const Stmt *T)
Definition: StmtObjC.h:62
void setForLoc(SourceLocation Loc)
Definition: StmtObjC.h:53
SourceLocation getForLoc() const
Definition: StmtObjC.h:52
SourceLocation getBeginLoc() const LLVM_READONLY
Definition: StmtObjC.h:110
SourceLocation getEndLoc() const LLVM_READONLY
Definition: Stmt.cpp:276
void setAtTryLoc(SourceLocation Loc)
Definition: StmtObjC.h:205
const_child_range children() const
Definition: StmtObjC.h:326
void setSynchExpr(Stmt *S)
Definition: StmtObjC.h:311
Encodes a location in the source.
const Stmt * getCatchBody() const
Definition: StmtObjC.h:93
SourceLocation getBeginLoc() const LLVM_READONLY
Definition: StmtObjC.h:383
void setAtCatchLoc(SourceLocation Loc)
Definition: StmtObjC.h:106
void setCatchParamDecl(VarDecl *D)
Definition: StmtObjC.h:103
child_range children()
Definition: StmtObjC.h:155
SourceLocation getAtFinallyLoc() const
Definition: StmtObjC.h:148
void setThrowLoc(SourceLocation Loc)
Definition: StmtObjC.h:349
SourceLocation getAtCatchLoc() const
Definition: StmtObjC.h:105
ObjCAutoreleasePoolStmt(SourceLocation atLoc, Stmt *subStmt)
Definition: StmtObjC.h:373
A placeholder type used to construct an empty shell of a type, that will be filled in later (e...
Definition: Stmt.h:1034
Dataflow Directional Tag Classes.
const_child_range children() const
Definition: StmtObjC.h:264
const Stmt * getFinallyBody() const
Definition: StmtObjC.h:139
void setCollection(Expr *E)
Definition: StmtObjC.h:47
SourceLocation getBeginLoc() const LLVM_READONLY
Definition: StmtObjC.h:313
StmtClass getStmtClass() const
Definition: Stmt.h:1087
static bool classof(const Stmt *T)
Definition: StmtObjC.h:318
const Expr * getSynchExpr() const
Definition: StmtObjC.h:305
SourceLocation getRParenLoc() const
Definition: StmtObjC.h:54
void setElement(Stmt *S)
Definition: StmtObjC.h:46
void setCatchStmt(unsigned I, ObjCAtCatchStmt *S)
Set a particular catch statement.
Definition: StmtObjC.h:229
Represents Objective-C&#39;s collection statement.
Definition: StmtObjC.h:23
bool hasEllipsis() const
Definition: StmtObjC.h:113
child_range children()
Definition: StmtObjC.h:259
void setAtFinallyLoc(SourceLocation Loc)
Definition: StmtObjC.h:149
Represents Objective-C&#39;s @finally statement.
Definition: StmtObjC.h:127
void setCatchBody(Stmt *S)
Definition: StmtObjC.h:95
child_range children()
Definition: StmtObjC.h:119
child_range children()
Definition: StmtObjC.h:360
void setAtSynchronizedLoc(SourceLocation Loc)
Definition: StmtObjC.h:295
const_child_range children() const
Definition: StmtObjC.h:362
ObjCAtFinallyStmt(EmptyShell Empty)
Definition: StmtObjC.h:136
ObjCAtThrowStmt(EmptyShell Empty)
Definition: StmtObjC.h:341
SourceLocation getAtSynchronizedLoc() const
Definition: StmtObjC.h:294
Represents Objective-C&#39;s @try ... @catch ... @finally statement.
Definition: StmtObjC.h:165
unsigned getNumCatchStmts() const
Retrieve the number of @catch statements in this try-catch-finally block.
Definition: StmtObjC.h:214
void setTryBody(Stmt *S)
Definition: StmtObjC.h:210
SourceLocation getBeginLoc() const LLVM_READONLY
Definition: StmtObjC.h:143
const_child_range children() const
Definition: StmtObjC.h:121
const VarDecl * getCatchParamDecl() const
Definition: StmtObjC.h:97
SourceLocation getEndLoc() const LLVM_READONLY
Definition: StmtObjC.h:314
Represents Objective-C&#39;s @autoreleasepool Statement.
Definition: StmtObjC.h:368
SourceLocation getBeginLoc() const LLVM_READONLY
Definition: StmtObjC.h:351
static OMPLinearClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, OpenMPLinearClauseKind Modifier, SourceLocation ModifierLoc, SourceLocation ColonLoc, SourceLocation EndLoc, ArrayRef< Expr *> VL, ArrayRef< Expr *> PL, ArrayRef< Expr *> IL, Expr *Step, Expr *CalcStep, Stmt *PreInit, Expr *PostUpdate)
Creates clause with a list of variables VL and a linear step Step.
void setAtLoc(SourceLocation Loc)
Definition: StmtObjC.h:389