12#ifndef LLVM_CLANG_AST_STMTOBJC_H 
   13#define LLVM_CLANG_AST_STMTOBJC_H 
   16#include "llvm/Support/Compiler.h" 
   24  enum { ELEM, COLLECTION, BODY, END_EXPR };
 
   25  Stmt* SubExprs[END_EXPR]; 
 
   32    Stmt(ObjCForCollectionStmtClass, 
Empty) { }
 
 
   36    return reinterpret_cast<Expr*
>(SubExprs[COLLECTION]);
 
 
   42    return reinterpret_cast<Expr*
>(SubExprs[COLLECTION]);
 
 
   48    SubExprs[COLLECTION] = 
reinterpret_cast<Stmt*
>(E);
 
 
   59    return SubExprs[BODY]->getEndLoc();
 
 
   63    return T->getStmtClass() == ObjCForCollectionStmtClass;
 
 
   68    return child_range(&SubExprs[0], &SubExprs[END_EXPR]);
 
 
 
   87    : 
Stmt(ObjCAtCatchStmtClass), ExceptionDecl(catchVarDecl),
 
   88    Body(atCatchStmt), AtCatchLoc(atCatchLoc), RParenLoc(rparenloc) { }
 
 
  101    return ExceptionDecl;
 
 
  116    return T->getStmtClass() == ObjCAtCatchStmtClass;
 
 
 
  133      : 
Stmt(ObjCAtFinallyStmtClass), AtFinallyLoc(atFinallyLoc),
 
  134        AtFinallyStmt(atFinallyStmt) {}
 
 
  145    return AtFinallyStmt->getEndLoc();
 
 
  152    return T->getStmtClass() == ObjCAtFinallyStmtClass;
 
 
  156    return child_range(&AtFinallyStmt, &AtFinallyStmt+1);
 
 
 
  165class ObjCAtTryStmt final
 
  167      private llvm::TrailingObjects<ObjCAtTryStmt, Stmt *> {
 
  168  friend TrailingObjects;
 
  170  size_t numTrailingStatements()
 const {
 
  171    return 1 + NumCatchStmts + HasFinally;
 
  178  unsigned NumCatchStmts : 16;
 
  181  LLVM_PREFERRED_TYPE(
bool)
 
  182  unsigned HasFinally : 1;
 
  189  Stmt **getStmts() { 
return getTrailingObjects(); }
 
  190  Stmt *
const *getStmts()
 const { 
return getTrailingObjects(); }
 
  193                Stmt **CatchStmts, 
unsigned NumCatchStmts,
 
  194                Stmt *atFinallyStmt);
 
  198    : 
Stmt(ObjCAtTryStmtClass, 
Empty), NumCatchStmts(NumCatchStmts),
 
  199      HasFinally(HasFinally) { }
 
  204                               Stmt **CatchStmts, 
unsigned NumCatchStmts,
 
  205                               Stmt *atFinallyStmt);
 
  207                                    unsigned NumCatchStmts, 
bool HasFinally);
 
  224    assert(I < NumCatchStmts && 
"Out-of-bounds @catch index");
 
  225    return cast_or_null<ObjCAtCatchStmt>(getStmts()[I + 1]);
 
 
  230    assert(I < NumCatchStmts && 
"Out-of-bounds @catch index");
 
  231    return cast_or_null<ObjCAtCatchStmt>(getStmts()[I + 1]);
 
 
  236    assert(I < NumCatchStmts && 
"Out-of-bounds @catch index");
 
  237    getStmts()[I + 1] = S;
 
 
  245    return cast_or_null<ObjCAtFinallyStmt>(getStmts()[1 + NumCatchStmts]);
 
 
  251    return cast_or_null<ObjCAtFinallyStmt>(getStmts()[1 + NumCatchStmts]);
 
 
  254    assert(HasFinally && 
"@try does not have a @finally slot!");
 
  255    getStmts()[1 + NumCatchStmts] = S;
 
 
  262    return T->getStmtClass() == ObjCAtTryStmtClass;
 
 
  266    return child_range(getStmts(), getStmts() + numTrailingStatements());
 
 
 
  306  enum { SYNC_EXPR, SYNC_BODY, END_EXPR };
 
  307  Stmt* SubStmts[END_EXPR];
 
  312  : 
Stmt(ObjCAtSynchronizedStmtClass) {
 
  313    SubStmts[SYNC_EXPR] = synchExpr;
 
  314    SubStmts[SYNC_BODY] = synchBody;
 
  315    AtSynchronizedLoc = atSynchronizedLoc;
 
 
  318    Stmt(ObjCAtSynchronizedStmtClass, 
Empty) { }
 
 
  324    return reinterpret_cast<CompoundStmt*
>(SubStmts[SYNC_BODY]);
 
 
  327    return reinterpret_cast<CompoundStmt*
>(SubStmts[SYNC_BODY]);
 
 
  332    return reinterpret_cast<Expr*
>(SubStmts[SYNC_EXPR]);
 
 
  335    return reinterpret_cast<Expr*
>(SubStmts[SYNC_EXPR]);
 
 
  345    return T->getStmtClass() == ObjCAtSynchronizedStmtClass;
 
 
  349    return child_range(&SubStmts[0], &SubStmts[0]+END_EXPR);
 
 
 
  364  : 
Stmt(ObjCAtThrowStmtClass), Throw(throwExpr) {
 
  365    AtThrowLoc = atThrowLoc;
 
 
  379    return Throw ? Throw->getEndLoc() : AtThrowLoc;
 
 
  383    return T->getStmtClass() == ObjCAtThrowStmtClass;
 
 
 
  400      : 
Stmt(ObjCAutoreleasePoolStmtClass), AtLoc(atLoc), SubStmt(subStmt) {}
 
 
  403    Stmt(ObjCAutoreleasePoolStmtClass, 
Empty) { }
 
 
  411    return SubStmt->getEndLoc();
 
 
  418    return T->getStmtClass() == ObjCAutoreleasePoolStmtClass;
 
 
 
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
 
CompoundStmt - This represents a group of statements like { stmt stmt }.
 
SourceLocation getEndLoc() const
 
This represents one expression.
 
Represents Objective-C's @catch statement.
 
const VarDecl * getCatchParamDecl() const
 
const_child_range children() const
 
const Stmt * getCatchBody() const
 
SourceLocation getEndLoc() const LLVM_READONLY
 
ObjCAtCatchStmt(EmptyShell Empty)
 
void setCatchParamDecl(VarDecl *D)
 
void setCatchBody(Stmt *S)
 
static bool classof(const Stmt *T)
 
void setRParenLoc(SourceLocation Loc)
 
SourceLocation getAtCatchLoc() const
 
VarDecl * getCatchParamDecl()
 
ObjCAtCatchStmt(SourceLocation atCatchLoc, SourceLocation rparenloc, VarDecl *catchVarDecl, Stmt *atCatchStmt)
 
SourceLocation getBeginLoc() const LLVM_READONLY
 
void setAtCatchLoc(SourceLocation Loc)
 
SourceLocation getRParenLoc() const
 
Represents Objective-C's @finally statement.
 
const Stmt * getFinallyBody() const
 
void setFinallyBody(Stmt *S)
 
SourceLocation getBeginLoc() const LLVM_READONLY
 
ObjCAtFinallyStmt(SourceLocation atFinallyLoc, Stmt *atFinallyStmt)
 
static bool classof(const Stmt *T)
 
void setAtFinallyLoc(SourceLocation Loc)
 
ObjCAtFinallyStmt(EmptyShell Empty)
 
SourceLocation getAtFinallyLoc() const
 
const_child_range children() const
 
SourceLocation getEndLoc() const LLVM_READONLY
 
const Expr * getSynchExpr() const
 
CompoundStmt * getSynchBody()
 
ObjCAtSynchronizedStmt(SourceLocation atSynchronizedLoc, Stmt *synchExpr, Stmt *synchBody)
 
void setSynchBody(Stmt *S)
 
const CompoundStmt * getSynchBody() const
 
void setAtSynchronizedLoc(SourceLocation Loc)
 
SourceLocation getAtSynchronizedLoc() const
 
const_child_range children() const
 
SourceLocation getBeginLoc() const LLVM_READONLY
 
ObjCAtSynchronizedStmt(EmptyShell Empty)
 
void setSynchExpr(Stmt *S)
 
static bool classof(const Stmt *T)
 
SourceLocation getEndLoc() const LLVM_READONLY
 
const Expr * getThrowExpr() const
 
void setThrowLoc(SourceLocation Loc)
 
static bool classof(const Stmt *T)
 
ObjCAtThrowStmt(SourceLocation atThrowLoc, Stmt *throwExpr)
 
const_child_range children() const
 
SourceLocation getThrowLoc() const LLVM_READONLY
 
void setThrowExpr(Stmt *S)
 
SourceLocation getBeginLoc() const LLVM_READONLY
 
ObjCAtThrowStmt(EmptyShell Empty)
 
SourceLocation getEndLoc() const LLVM_READONLY
 
void setAtTryLoc(SourceLocation Loc)
 
llvm::iterator_range< const_catch_stmt_iterator > catch_const_range
 
ConstCastIterator< ObjCAtCatchStmt > const_catch_stmt_iterator
 
const ObjCAtFinallyStmt * getFinallyStmt() const
Retrieve the @finally statement, if any.
 
void setFinallyStmt(Stmt *S)
 
catch_stmt_iterator catch_stmts_end()
 
const_child_range children() const
 
static ObjCAtTryStmt * CreateEmpty(const ASTContext &Context, unsigned NumCatchStmts, bool HasFinally)
 
llvm::iterator_range< catch_stmt_iterator > catch_range
 
unsigned getNumCatchStmts() const
Retrieve the number of @catch statements in this try-catch-finally block.
 
catch_stmt_iterator catch_stmts_begin()
 
ObjCAtFinallyStmt * getFinallyStmt()
 
CastIterator< ObjCAtCatchStmt > catch_stmt_iterator
 
SourceLocation getBeginLoc() const LLVM_READONLY
 
void setCatchStmt(unsigned I, ObjCAtCatchStmt *S)
Set a particular catch statement.
 
static bool classof(const Stmt *T)
 
const ObjCAtCatchStmt * getCatchStmt(unsigned I) const
Retrieve a @catch statement.
 
const Stmt * getTryBody() const
Retrieve the @try body.
 
catch_const_range catch_stmts() const
 
SourceLocation getEndLoc() const LLVM_READONLY
 
const_catch_stmt_iterator catch_stmts_begin() const
 
SourceLocation getAtTryLoc() const
Retrieve the location of the @ in the @try.
 
const_catch_stmt_iterator catch_stmts_end() const
 
ObjCAtCatchStmt * getCatchStmt(unsigned I)
Retrieve a @catch statement.
 
catch_range catch_stmts()
 
void setAtLoc(SourceLocation Loc)
 
const_child_range children() const
 
ObjCAutoreleasePoolStmt(EmptyShell Empty)
 
SourceLocation getAtLoc() const
 
static bool classof(const Stmt *T)
 
SourceLocation getBeginLoc() const LLVM_READONLY
 
ObjCAutoreleasePoolStmt(SourceLocation atLoc, Stmt *subStmt)
 
const Stmt * getSubStmt() const
 
SourceLocation getEndLoc() const LLVM_READONLY
 
ObjCForCollectionStmt(EmptyShell Empty)
 
const Stmt * getElement() const
 
void setCollection(Expr *E)
 
void setForLoc(SourceLocation Loc)
 
SourceLocation getForLoc() const
 
const_child_range children() const
 
static bool classof(const Stmt *T)
 
void setRParenLoc(SourceLocation Loc)
 
SourceLocation getEndLoc() const LLVM_READONLY
 
SourceLocation getRParenLoc() const
 
const Expr * getCollection() const
 
const Stmt * getBody() const
 
SourceLocation getBeginLoc() const LLVM_READONLY
 
ObjCForCollectionStmt(Stmt *Elem, Expr *Collect, Stmt *Body, SourceLocation FCL, SourceLocation RPL)
 
Encodes a location in the source.
 
CastIterator< T, const T *const, const Stmt *const  > ConstCastIterator
Const iterator for iterating over Stmt * arrays that contain only T *.
 
Stmt(StmtClass SC, EmptyShell)
Construct an empty statement.
 
llvm::iterator_range< child_iterator > child_range
 
llvm::iterator_range< const_child_iterator > const_child_range
 
Represents a variable declaration or definition.
 
The JSON file list parser is used to communicate input to InstallAPI.
 
@ Create
'create' clause, allowed on Compute and Combined constructs, plus 'data', 'enter data',...
 
const FunctionProtoType * T
 
Iterator for iterating over Stmt * arrays that contain only T *.
 
A placeholder type used to construct an empty shell of a type, that will be filled in later (e....