19 using namespace clang;
24 :
Stmt(ObjCForCollectionStmtClass) {
25 SubExprs[ELEM] = Elem;
26 SubExprs[COLLECTION] = Collect;
27 SubExprs[BODY] = Body;
33 Stmt **CatchStmts,
unsigned NumCatchStmts,
35 :
Stmt(ObjCAtTryStmtClass), AtTryLoc(atTryLoc),
36 NumCatchStmts(NumCatchStmts), HasFinally(atFinallyStmt != nullptr) {
37 Stmt **Stmts = getStmts();
39 for (
unsigned I = 0;
I != NumCatchStmts; ++
I)
40 Stmts[
I + 1] = CatchStmts[
I];
43 Stmts[NumCatchStmts + 1] = atFinallyStmt;
48 Stmt **CatchStmts,
unsigned NumCatchStmts,
49 Stmt *atFinallyStmt) {
52 (1 + NumCatchStmts + (atFinallyStmt !=
nullptr)) *
sizeof(
Stmt *);
53 void *Mem = Context.
Allocate(Size, llvm::alignOf<ObjCAtTryStmt>());
54 return new (Mem)
ObjCAtTryStmt(atTryLoc, atTryStmt, CatchStmts, NumCatchStmts,
59 unsigned NumCatchStmts,
63 void *Mem = Context.
Allocate(Size, llvm::alignOf<ObjCAtTryStmt>());
64 return new (Mem)
ObjCAtTryStmt(EmptyShell(), NumCatchStmts, HasFinally);
SourceLocation getLocEnd() const LLVM_READONLY
Defines the clang::ASTContext interface.
const ObjCAtFinallyStmt * getFinallyStmt() const
Retrieve the @finally statement, if any.
Defines the Objective-C statement AST node classes.
SourceLocation getLocEnd() const LLVM_READONLY
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
const ObjCAtCatchStmt * getCatchStmt(unsigned I) const
Retrieve a @catch statement.
detail::InMemoryDirectory::const_iterator I
Expr - This represents one expression.
ObjCForCollectionStmt(Stmt *Elem, Expr *Collect, Stmt *Body, SourceLocation FCL, SourceLocation RPL)
Encodes a location in the source.
static ObjCAtTryStmt * CreateEmpty(const ASTContext &Context, unsigned NumCatchStmts, bool HasFinally)
SourceLocation getLocEnd() const LLVM_READONLY
void * Allocate(size_t Size, unsigned Align=8) const
Represents Objective-C's @try ... @catch ... @finally statement.
const Stmt * getTryBody() const
Retrieve the @try body.
static ObjCAtTryStmt * Create(const ASTContext &Context, SourceLocation atTryLoc, Stmt *atTryStmt, Stmt **CatchStmts, unsigned NumCatchStmts, Stmt *atFinallyStmt)