clang  15.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 
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 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  bool HasFinally : 1;
181 
182  /// Retrieve the statements that are stored after this \@try statement.
183  ///
184  /// The order of the statements in memory follows the order in the source,
185  /// with the \@try body first, followed by the \@catch statements (if any)
186  /// and, finally, the \@finally (if it exists).
187  Stmt **getStmts() { return getTrailingObjects<Stmt *>(); }
188  Stmt *const *getStmts() const { return getTrailingObjects<Stmt *>(); }
189 
190  ObjCAtTryStmt(SourceLocation atTryLoc, Stmt *atTryStmt,
191  Stmt **CatchStmts, unsigned NumCatchStmts,
192  Stmt *atFinallyStmt);
193 
194  explicit ObjCAtTryStmt(EmptyShell Empty, unsigned NumCatchStmts,
195  bool HasFinally)
196  : Stmt(ObjCAtTryStmtClass, Empty), NumCatchStmts(NumCatchStmts),
197  HasFinally(HasFinally) { }
198 
199 public:
200  static ObjCAtTryStmt *Create(const ASTContext &Context,
201  SourceLocation atTryLoc, Stmt *atTryStmt,
202  Stmt **CatchStmts, unsigned NumCatchStmts,
203  Stmt *atFinallyStmt);
204  static ObjCAtTryStmt *CreateEmpty(const ASTContext &Context,
205  unsigned NumCatchStmts, bool HasFinally);
206 
207  /// Retrieve the location of the @ in the \@try.
208  SourceLocation getAtTryLoc() const { return AtTryLoc; }
209  void setAtTryLoc(SourceLocation Loc) { AtTryLoc = Loc; }
210 
211  /// Retrieve the \@try body.
212  const Stmt *getTryBody() const { return getStmts()[0]; }
213  Stmt *getTryBody() { return getStmts()[0]; }
214  void setTryBody(Stmt *S) { getStmts()[0] = S; }
215 
216  /// Retrieve the number of \@catch statements in this try-catch-finally
217  /// block.
218  unsigned getNumCatchStmts() const { return NumCatchStmts; }
219 
220  /// Retrieve a \@catch statement.
221  const ObjCAtCatchStmt *getCatchStmt(unsigned I) const {
222  assert(I < NumCatchStmts && "Out-of-bounds @catch index");
223  return cast_or_null<ObjCAtCatchStmt>(getStmts()[I + 1]);
224  }
225 
226  /// Retrieve a \@catch statement.
228  assert(I < NumCatchStmts && "Out-of-bounds @catch index");
229  return cast_or_null<ObjCAtCatchStmt>(getStmts()[I + 1]);
230  }
231 
232  /// Set a particular catch statement.
233  void setCatchStmt(unsigned I, ObjCAtCatchStmt *S) {
234  assert(I < NumCatchStmts && "Out-of-bounds @catch index");
235  getStmts()[I + 1] = S;
236  }
237 
238  /// Retrieve the \@finally statement, if any.
240  if (!HasFinally)
241  return nullptr;
242 
243  return cast_or_null<ObjCAtFinallyStmt>(getStmts()[1 + NumCatchStmts]);
244  }
246  if (!HasFinally)
247  return nullptr;
248 
249  return cast_or_null<ObjCAtFinallyStmt>(getStmts()[1 + NumCatchStmts]);
250  }
251  void setFinallyStmt(Stmt *S) {
252  assert(HasFinally && "@try does not have a @finally slot!");
253  getStmts()[1 + NumCatchStmts] = S;
254  }
255 
256  SourceLocation getBeginLoc() const LLVM_READONLY { return AtTryLoc; }
257  SourceLocation getEndLoc() const LLVM_READONLY;
258 
259  static bool classof(const Stmt *T) {
260  return T->getStmtClass() == ObjCAtTryStmtClass;
261  }
262 
264  return child_range(
265  getStmts(), getStmts() + numTrailingObjects(OverloadToken<Stmt *>()));
266  }
267 
269  return const_child_range(const_cast<ObjCAtTryStmt *>(this)->children());
270  }
271 
274  using catch_range = llvm::iterator_range<catch_stmt_iterator>;
275  using catch_const_range = llvm::iterator_range<const_catch_stmt_iterator>;
276 
277  catch_stmt_iterator catch_stmts_begin() { return getStmts() + 1; }
279  return catch_stmts_begin() + NumCatchStmts;
280  }
283  }
284 
285  const_catch_stmt_iterator catch_stmts_begin() const { return getStmts() + 1; }
287  return catch_stmts_begin() + NumCatchStmts;
288  }
291  }
292 };
293 
294 /// Represents Objective-C's \@synchronized statement.
295 ///
296 /// Example:
297 /// \code
298 /// @synchronized (sem) {
299 /// do-something;
300 /// }
301 /// \endcode
302 class ObjCAtSynchronizedStmt : public Stmt {
303 private:
304  SourceLocation AtSynchronizedLoc;
305  enum { SYNC_EXPR, SYNC_BODY, END_EXPR };
306  Stmt* SubStmts[END_EXPR];
307 
308 public:
309  ObjCAtSynchronizedStmt(SourceLocation atSynchronizedLoc, Stmt *synchExpr,
310  Stmt *synchBody)
311  : Stmt(ObjCAtSynchronizedStmtClass) {
312  SubStmts[SYNC_EXPR] = synchExpr;
313  SubStmts[SYNC_BODY] = synchBody;
314  AtSynchronizedLoc = atSynchronizedLoc;
315  }
317  Stmt(ObjCAtSynchronizedStmtClass, Empty) { }
318 
319  SourceLocation getAtSynchronizedLoc() const { return AtSynchronizedLoc; }
320  void setAtSynchronizedLoc(SourceLocation Loc) { AtSynchronizedLoc = Loc; }
321 
322  const CompoundStmt *getSynchBody() const {
323  return reinterpret_cast<CompoundStmt*>(SubStmts[SYNC_BODY]);
324  }
326  return reinterpret_cast<CompoundStmt*>(SubStmts[SYNC_BODY]);
327  }
328  void setSynchBody(Stmt *S) { SubStmts[SYNC_BODY] = S; }
329 
330  const Expr *getSynchExpr() const {
331  return reinterpret_cast<Expr*>(SubStmts[SYNC_EXPR]);
332  }
334  return reinterpret_cast<Expr*>(SubStmts[SYNC_EXPR]);
335  }
336  void setSynchExpr(Stmt *S) { SubStmts[SYNC_EXPR] = S; }
337 
338  SourceLocation getBeginLoc() const LLVM_READONLY { return AtSynchronizedLoc; }
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 
352  return const_child_range(&SubStmts[0], &SubStmts[0] + END_EXPR);
353  }
354 };
355 
356 /// Represents Objective-C's \@throw statement.
357 class ObjCAtThrowStmt : public Stmt {
358  SourceLocation AtThrowLoc;
359  Stmt *Throw;
360 
361 public:
362  ObjCAtThrowStmt(SourceLocation atThrowLoc, Stmt *throwExpr)
363  : Stmt(ObjCAtThrowStmtClass), Throw(throwExpr) {
364  AtThrowLoc = atThrowLoc;
365  }
366  explicit ObjCAtThrowStmt(EmptyShell Empty) :
367  Stmt(ObjCAtThrowStmtClass, Empty) { }
368 
369  const Expr *getThrowExpr() const { return reinterpret_cast<Expr*>(Throw); }
370  Expr *getThrowExpr() { return reinterpret_cast<Expr*>(Throw); }
371  void setThrowExpr(Stmt *S) { Throw = S; }
372 
373  SourceLocation getThrowLoc() const LLVM_READONLY { return AtThrowLoc; }
374  void setThrowLoc(SourceLocation Loc) { AtThrowLoc = Loc; }
375 
376  SourceLocation getBeginLoc() const LLVM_READONLY { return AtThrowLoc; }
377  SourceLocation getEndLoc() const LLVM_READONLY {
378  return Throw ? Throw->getEndLoc() : AtThrowLoc;
379  }
380 
381  static bool classof(const Stmt *T) {
382  return T->getStmtClass() == ObjCAtThrowStmtClass;
383  }
384 
385  child_range children() { return child_range(&Throw, &Throw+1); }
386 
388  return const_child_range(&Throw, &Throw + 1);
389  }
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  SourceLocation getBeginLoc() const LLVM_READONLY { return AtLoc; }
409  SourceLocation getEndLoc() const LLVM_READONLY {
410  return SubStmt->getEndLoc();
411  }
412 
413  SourceLocation getAtLoc() const { return AtLoc; }
414  void setAtLoc(SourceLocation Loc) { AtLoc = Loc; }
415 
416  static bool classof(const Stmt *T) {
417  return T->getStmtClass() == ObjCAutoreleasePoolStmtClass;
418  }
419 
420  child_range children() { return child_range(&SubStmt, &SubStmt + 1); }
421 
423  return const_child_range(&SubStmt, &SubStmt + 1);
424  }
425 };
426 
427 } // end namespace clang
428 
429 #endif
clang::Stmt::Stmt
Stmt()=delete
clang::ObjCAutoreleasePoolStmt::getAtLoc
SourceLocation getAtLoc() const
Definition: StmtObjC.h:413
clang::ObjCAtTryStmt::getNumCatchStmts
unsigned getNumCatchStmts() const
Retrieve the number of @catch statements in this try-catch-finally block.
Definition: StmtObjC.h:218
clang::ObjCForCollectionStmt::setRParenLoc
void setRParenLoc(SourceLocation Loc)
Definition: StmtObjC.h:55
clang::ObjCForCollectionStmt::getElement
Stmt * getElement()
Definition: StmtObjC.h:34
clang::ObjCAutoreleasePoolStmt::getEndLoc
SourceLocation getEndLoc() const LLVM_READONLY
Definition: StmtObjC.h:409
clang::ObjCAutoreleasePoolStmt::children
const_child_range children() const
Definition: StmtObjC.h:422
clang::ObjCAutoreleasePoolStmt::getSubStmt
const Stmt * getSubStmt() const
Definition: StmtObjC.h:404
clang::SourceLocation
Encodes a location in the source.
Definition: SourceLocation.h:86
clang::ObjCAutoreleasePoolStmt::children
child_range children()
Definition: StmtObjC.h:420
clang::ObjCAtFinallyStmt::classof
static bool classof(const Stmt *T)
Definition: StmtObjC.h:151
clang::ObjCAutoreleasePoolStmt::getBeginLoc
SourceLocation getBeginLoc() const LLVM_READONLY
Definition: StmtObjC.h:408
clang::ObjCAtFinallyStmt::setFinallyBody
void setFinallyBody(Stmt *S)
Definition: StmtObjC.h:141
clang::ObjCForCollectionStmt::ObjCForCollectionStmt
ObjCForCollectionStmt(Stmt *Elem, Expr *Collect, Stmt *Body, SourceLocation FCL, SourceLocation RPL)
Definition: StmtObjC.cpp:20
clang::ObjCForCollectionStmt::setCollection
void setCollection(Expr *E)
Definition: StmtObjC.h:47
clang::ObjCAtSynchronizedStmt::getBeginLoc
SourceLocation getBeginLoc() const LLVM_READONLY
Definition: StmtObjC.h:338
clang::ObjCAtTryStmt::Create
static ObjCAtTryStmt * Create(const ASTContext &Context, SourceLocation atTryLoc, Stmt *atTryStmt, Stmt **CatchStmts, unsigned NumCatchStmts, Stmt *atFinallyStmt)
Definition: StmtObjC.cpp:45
clang::ObjCAtSynchronizedStmt::classof
static bool classof(const Stmt *T)
Definition: StmtObjC.h:343
clang::ObjCAtSynchronizedStmt::getSynchBody
const CompoundStmt * getSynchBody() const
Definition: StmtObjC.h:322
clang::ObjCAtCatchStmt::hasEllipsis
bool hasEllipsis() const
Definition: StmtObjC.h:113
clang::ObjCAtThrowStmt::getEndLoc
SourceLocation getEndLoc() const LLVM_READONLY
Definition: StmtObjC.h:377
clang::ObjCAtSynchronizedStmt::setSynchBody
void setSynchBody(Stmt *S)
Definition: StmtObjC.h:328
clang::ObjCAtThrowStmt::ObjCAtThrowStmt
ObjCAtThrowStmt(SourceLocation atThrowLoc, Stmt *throwExpr)
Definition: StmtObjC.h:362
clang::ObjCForCollectionStmt::setForLoc
void setForLoc(SourceLocation Loc)
Definition: StmtObjC.h:53
clang::ObjCAtCatchStmt::setCatchParamDecl
void setCatchParamDecl(VarDecl *D)
Definition: StmtObjC.h:103
clang::ObjCAtTryStmt
Represents Objective-C's @try ... @catch ... @finally statement.
Definition: StmtObjC.h:165
clang::ObjCForCollectionStmt::getRParenLoc
SourceLocation getRParenLoc() const
Definition: StmtObjC.h:54
clang::ObjCAtFinallyStmt::getAtFinallyLoc
SourceLocation getAtFinallyLoc() const
Definition: StmtObjC.h:148
clang::ObjCForCollectionStmt::classof
static bool classof(const Stmt *T)
Definition: StmtObjC.h:62
clang::ObjCForCollectionStmt::getForLoc
SourceLocation getForLoc() const
Definition: StmtObjC.h:52
clang::ObjCAtFinallyStmt::getFinallyBody
const Stmt * getFinallyBody() const
Definition: StmtObjC.h:139
clang::ObjCAutoreleasePoolStmt::setAtLoc
void setAtLoc(SourceLocation Loc)
Definition: StmtObjC.h:414
clang::ObjCForCollectionStmt
Represents Objective-C's collection statement.
Definition: StmtObjC.h:23
clang::ObjCAtThrowStmt::ObjCAtThrowStmt
ObjCAtThrowStmt(EmptyShell Empty)
Definition: StmtObjC.h:366
clang::ObjCAtTryStmt::getCatchStmt
ObjCAtCatchStmt * getCatchStmt(unsigned I)
Retrieve a @catch statement.
Definition: StmtObjC.h:227
clang::ObjCAtFinallyStmt::getFinallyBody
Stmt * getFinallyBody()
Definition: StmtObjC.h:140
clang::ObjCAtTryStmt::catch_stmts
catch_range catch_stmts()
Definition: StmtObjC.h:281
clang::Stmt::EmptyShell
A placeholder type used to construct an empty shell of a type, that will be filled in later (e....
Definition: Stmt.h:1100
clang::ObjCAutoreleasePoolStmt::classof
static bool classof(const Stmt *T)
Definition: StmtObjC.h:416
clang::ObjCAtFinallyStmt::children
child_range children()
Definition: StmtObjC.h:155
clang::ObjCAtCatchStmt::classof
static bool classof(const Stmt *T)
Definition: StmtObjC.h:115
clang::ObjCAtSynchronizedStmt::ObjCAtSynchronizedStmt
ObjCAtSynchronizedStmt(EmptyShell Empty)
Definition: StmtObjC.h:316
clang::ObjCAtThrowStmt::children
child_range children()
Definition: StmtObjC.h:385
clang::ObjCAtThrowStmt::getBeginLoc
SourceLocation getBeginLoc() const LLVM_READONLY
Definition: StmtObjC.h:376
clang::ObjCAtCatchStmt
Represents Objective-C's @catch statement.
Definition: StmtObjC.h:77
clang::CompoundStmt
CompoundStmt - This represents a group of statements like { stmt stmt }.
Definition: Stmt.h:1401
clang::ObjCAtCatchStmt::setAtCatchLoc
void setAtCatchLoc(SourceLocation Loc)
Definition: StmtObjC.h:106
clang::ObjCAtCatchStmt::setCatchBody
void setCatchBody(Stmt *S)
Definition: StmtObjC.h:95
clang::ObjCAtFinallyStmt::children
const_child_range children() const
Definition: StmtObjC.h:159
clang::ObjCAtTryStmt::setAtTryLoc
void setAtTryLoc(SourceLocation Loc)
Definition: StmtObjC.h:209
clang::ObjCAtCatchStmt::children
const_child_range children() const
Definition: StmtObjC.h:121
clang::ObjCAtCatchStmt::getCatchParamDecl
VarDecl * getCatchParamDecl()
Definition: StmtObjC.h:100
clang::ObjCAtThrowStmt
Represents Objective-C's @throw statement.
Definition: StmtObjC.h:357
clang::ASTContext
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Definition: ASTContext.h:208
clang::Stmt::CastIterator
Iterator for iterating over Stmt * arrays that contain only T *.
Definition: Stmt.h:1116
clang::ObjCAutoreleasePoolStmt::getSubStmt
Stmt * getSubStmt()
Definition: StmtObjC.h:405
clang::ObjCAtThrowStmt::children
const_child_range children() const
Definition: StmtObjC.h:387
clang::ObjCForCollectionStmt::setElement
void setElement(Stmt *S)
Definition: StmtObjC.h:46
clang::ObjCAtThrowStmt::classof
static bool classof(const Stmt *T)
Definition: StmtObjC.h:381
clang::ObjCAtSynchronizedStmt
Represents Objective-C's @synchronized statement.
Definition: StmtObjC.h:302
clang::ObjCAtTryStmt::catch_stmts
catch_const_range catch_stmts() const
Definition: StmtObjC.h:289
clang::Stmt::getEndLoc
SourceLocation getEndLoc() const LLVM_READONLY
Definition: Stmt.cpp:348
clang::ObjCForCollectionStmt::getCollection
Expr * getCollection()
Definition: StmtObjC.h:35
clang::ObjCAtCatchStmt::getRParenLoc
SourceLocation getRParenLoc() const
Definition: StmtObjC.h:107
clang::ObjCAtCatchStmt::getBeginLoc
SourceLocation getBeginLoc() const LLVM_READONLY
Definition: StmtObjC.h:110
clang::VarDecl
Represents a variable declaration or definition.
Definition: Decl.h:874
clang::ObjCAtTryStmt::CreateEmpty
static ObjCAtTryStmt * CreateEmpty(const ASTContext &Context, unsigned NumCatchStmts, bool HasFinally)
Definition: StmtObjC.cpp:56
clang::ObjCAtSynchronizedStmt::getSynchExpr
Expr * getSynchExpr()
Definition: StmtObjC.h:333
clang::ObjCAtTryStmt::setFinallyStmt
void setFinallyStmt(Stmt *S)
Definition: StmtObjC.h:251
clang::ObjCAtFinallyStmt
Represents Objective-C's @finally statement.
Definition: StmtObjC.h:127
clang::ObjCAtTryStmt::getEndLoc
SourceLocation getEndLoc() const LLVM_READONLY
Definition: StmtObjC.cpp:64
clang::ObjCAtTryStmt::getTryBody
Stmt * getTryBody()
Definition: StmtObjC.h:213
clang::ObjCAtCatchStmt::getCatchBody
const Stmt * getCatchBody() const
Definition: StmtObjC.h:93
clang::Stmt::child_range
llvm::iterator_range< child_iterator > child_range
Definition: Stmt.h:1249
clang::ObjCAtFinallyStmt::getBeginLoc
SourceLocation getBeginLoc() const LLVM_READONLY
Definition: StmtObjC.h:143
clang::ObjCAtTryStmt::setCatchStmt
void setCatchStmt(unsigned I, ObjCAtCatchStmt *S)
Set a particular catch statement.
Definition: StmtObjC.h:233
clang::ObjCAtSynchronizedStmt::children
const_child_range children() const
Definition: StmtObjC.h:351
clang::CompoundStmt::getEndLoc
SourceLocation getEndLoc() const
Definition: Stmt.h:1508
clang::Stmt::const_child_range
llvm::iterator_range< const_child_iterator > const_child_range
Definition: Stmt.h:1250
clang::ObjCAtCatchStmt::setRParenLoc
void setRParenLoc(SourceLocation Loc)
Definition: StmtObjC.h:108
clang::ObjCAtTryStmt::catch_stmts_begin
catch_stmt_iterator catch_stmts_begin()
Definition: StmtObjC.h:277
clang::ObjCAtCatchStmt::getEndLoc
SourceLocation getEndLoc() const LLVM_READONLY
Definition: StmtObjC.h:111
clang::ObjCAtTryStmt::catch_const_range
llvm::iterator_range< const_catch_stmt_iterator > catch_const_range
Definition: StmtObjC.h:275
clang::ObjCAtThrowStmt::getThrowExpr
Expr * getThrowExpr()
Definition: StmtObjC.h:370
clang::ObjCAtThrowStmt::getThrowExpr
const Expr * getThrowExpr() const
Definition: StmtObjC.h:369
clang::ObjCAtTryStmt::catch_stmts_end
const_catch_stmt_iterator catch_stmts_end() const
Definition: StmtObjC.h:286
clang::Stmt::getStmtClass
StmtClass getStmtClass() const
Definition: Stmt.h:1160
clang::ObjCAtFinallyStmt::setAtFinallyLoc
void setAtFinallyLoc(SourceLocation Loc)
Definition: StmtObjC.h:149
clang::ObjCAtSynchronizedStmt::getAtSynchronizedLoc
SourceLocation getAtSynchronizedLoc() const
Definition: StmtObjC.h:319
clang::ObjCAtTryStmt::children
child_range children()
Definition: StmtObjC.h:263
clang::ObjCAtSynchronizedStmt::setAtSynchronizedLoc
void setAtSynchronizedLoc(SourceLocation Loc)
Definition: StmtObjC.h:320
clang::ObjCAtTryStmt::getAtTryLoc
SourceLocation getAtTryLoc() const
Retrieve the location of the @ in the @try.
Definition: StmtObjC.h:208
clang::ObjCAtFinallyStmt::getEndLoc
SourceLocation getEndLoc() const LLVM_READONLY
Definition: StmtObjC.h:144
clang::ObjCAtCatchStmt::ObjCAtCatchStmt
ObjCAtCatchStmt(SourceLocation atCatchLoc, SourceLocation rparenloc, VarDecl *catchVarDecl, Stmt *atCatchStmt)
Definition: StmtObjC.h:84
clang::ObjCForCollectionStmt::children
const_child_range children() const
Definition: StmtObjC.h:71
clang::ObjCAutoreleasePoolStmt::ObjCAutoreleasePoolStmt
ObjCAutoreleasePoolStmt(EmptyShell Empty)
Definition: StmtObjC.h:401
clang::ObjCAtSynchronizedStmt::children
child_range children()
Definition: StmtObjC.h:347
clang::ObjCAtCatchStmt::ObjCAtCatchStmt
ObjCAtCatchStmt(EmptyShell Empty)
Definition: StmtObjC.h:90
clang::ObjCForCollectionStmt::ObjCForCollectionStmt
ObjCForCollectionStmt(EmptyShell Empty)
Definition: StmtObjC.h:31
clang::ObjCAtTryStmt::getTryBody
const Stmt * getTryBody() const
Retrieve the @try body.
Definition: StmtObjC.h:212
clang::ObjCForCollectionStmt::getCollection
const Expr * getCollection() const
Definition: StmtObjC.h:41
clang::ObjCAtThrowStmt::getThrowLoc
SourceLocation getThrowLoc() const LLVM_READONLY
Definition: StmtObjC.h:373
clang::ObjCAtSynchronizedStmt::getEndLoc
SourceLocation getEndLoc() const LLVM_READONLY
Definition: StmtObjC.h:339
clang::ObjCAtTryStmt::classof
static bool classof(const Stmt *T)
Definition: StmtObjC.h:259
clang::ObjCForCollectionStmt::setBody
void setBody(Stmt *S)
Definition: StmtObjC.h:50
clang::ObjCAtCatchStmt::getAtCatchLoc
SourceLocation getAtCatchLoc() const
Definition: StmtObjC.h:105
clang::ObjCAtSynchronizedStmt::getSynchBody
CompoundStmt * getSynchBody()
Definition: StmtObjC.h:325
clang::ObjCAtFinallyStmt::ObjCAtFinallyStmt
ObjCAtFinallyStmt(EmptyShell Empty)
Definition: StmtObjC.h:136
clang
Definition: CalledOnceCheck.h:17
clang::ObjCAutoreleasePoolStmt::setSubStmt
void setSubStmt(Stmt *S)
Definition: StmtObjC.h:406
clang::ObjCForCollectionStmt::getBody
Stmt * getBody()
Definition: StmtObjC.h:38
clang::ObjCAtCatchStmt::getCatchBody
Stmt * getCatchBody()
Definition: StmtObjC.h:94
clang::Stmt
Stmt - This represents one statement.
Definition: Stmt.h:69
clang::ObjCAutoreleasePoolStmt
Represents Objective-C's @autoreleasepool Statement.
Definition: StmtObjC.h:393
clang::ObjCAtCatchStmt::getCatchParamDecl
const VarDecl * getCatchParamDecl() const
Definition: StmtObjC.h:97
clang::ObjCAtThrowStmt::setThrowExpr
void setThrowExpr(Stmt *S)
Definition: StmtObjC.h:371
clang::ObjCForCollectionStmt::getBeginLoc
SourceLocation getBeginLoc() const LLVM_READONLY
Definition: StmtObjC.h:57
clang::ObjCForCollectionStmt::children
child_range children()
Definition: StmtObjC.h:67
clang::ObjCAtTryStmt::getCatchStmt
const ObjCAtCatchStmt * getCatchStmt(unsigned I) const
Retrieve a @catch statement.
Definition: StmtObjC.h:221
clang::ObjCAtSynchronizedStmt::setSynchExpr
void setSynchExpr(Stmt *S)
Definition: StmtObjC.h:336
clang::ObjCAtTryStmt::children
const_child_range children() const
Definition: StmtObjC.h:268
Stmt.h
clang::ObjCAutoreleasePoolStmt::ObjCAutoreleasePoolStmt
ObjCAutoreleasePoolStmt(SourceLocation atLoc, Stmt *subStmt)
Definition: StmtObjC.h:398
clang::ObjCAtCatchStmt::children
child_range children()
Definition: StmtObjC.h:119
clang::ObjCAtTryStmt::catch_stmts_begin
const_catch_stmt_iterator catch_stmts_begin() const
Definition: StmtObjC.h:285
clang::Expr
This represents one expression.
Definition: Expr.h:109
clang::ObjCForCollectionStmt::getEndLoc
SourceLocation getEndLoc() const LLVM_READONLY
Definition: StmtObjC.h:58
clang::ObjCAtFinallyStmt::ObjCAtFinallyStmt
ObjCAtFinallyStmt(SourceLocation atFinallyLoc, Stmt *atFinallyStmt)
Definition: StmtObjC.h:132
clang::ObjCAtThrowStmt::setThrowLoc
void setThrowLoc(SourceLocation Loc)
Definition: StmtObjC.h:374
clang::ObjCAtSynchronizedStmt::getSynchExpr
const Expr * getSynchExpr() const
Definition: StmtObjC.h:330
clang::ObjCForCollectionStmt::getElement
const Stmt * getElement() const
Definition: StmtObjC.h:40
clang::ObjCAtTryStmt::getFinallyStmt
const ObjCAtFinallyStmt * getFinallyStmt() const
Retrieve the @finally statement, if any.
Definition: StmtObjC.h:239
clang::ObjCForCollectionStmt::getBody
const Stmt * getBody() const
Definition: StmtObjC.h:44
clang::ObjCAtTryStmt::catch_stmts_end
catch_stmt_iterator catch_stmts_end()
Definition: StmtObjC.h:278
clang::ObjCAtSynchronizedStmt::ObjCAtSynchronizedStmt
ObjCAtSynchronizedStmt(SourceLocation atSynchronizedLoc, Stmt *synchExpr, Stmt *synchBody)
Definition: StmtObjC.h:309
clang::ObjCAtTryStmt::setTryBody
void setTryBody(Stmt *S)
Definition: StmtObjC.h:214
clang::ObjCAtTryStmt::getFinallyStmt
ObjCAtFinallyStmt * getFinallyStmt()
Definition: StmtObjC.h:245
clang::ObjCAtTryStmt::getBeginLoc
SourceLocation getBeginLoc() const LLVM_READONLY
Definition: StmtObjC.h:256
clang::ObjCAtTryStmt::catch_range
llvm::iterator_range< catch_stmt_iterator > catch_range
Definition: StmtObjC.h:274