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