18 using namespace clang;
22 return ExceptionDecl->
getType();
29 Size += ((handlers.size() + 1) *
sizeof(
Stmt *));
31 void *Mem = C.
Allocate(Size, llvm::alignOf<CXXTryStmt>());
32 return new (Mem)
CXXTryStmt(tryLoc, tryBlock, handlers);
36 unsigned numHandlers) {
38 Size += ((numHandlers + 1) *
sizeof(
Stmt *));
40 void *Mem = C.
Allocate(Size, llvm::alignOf<CXXTryStmt>());
41 return new (Mem)
CXXTryStmt(Empty, numHandlers);
46 :
Stmt(CXXTryStmtClass), TryLoc(tryLoc), NumHandlers(handlers.size()) {
47 Stmt **Stmts =
reinterpret_cast<Stmt **
>(
this + 1);
49 std::copy(handlers.begin(), handlers.end(), Stmts + 1);
58 :
Stmt(CXXForRangeStmtClass), ForLoc(FL), CoawaitLoc(CAL),
ColonLoc(CL),
60 SubExprs[RANGE] = Range;
61 SubExprs[BEGINSTMT] = BeginStmt;
62 SubExprs[ENDSTMT] = EndStmt;
63 SubExprs[COND] = Cond;
65 SubExprs[LOOPVAR] = LoopVar;
66 SubExprs[BODY] = Body;
72 assert(RangeDecl &&
"for-range should have a single var decl");
82 assert(LV &&
"No loop variable in CXXForRangeStmt");
83 return cast<VarDecl>(LV);
Defines the clang::ASTContext interface.
A (possibly-)qualified type.
__SIZE_TYPE__ size_t
The unsigned integer type of the result of the sizeof operator.
const Expr * getInit() const
VarDecl - An instance of this class is created to represent a variable declaration or definition...
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
static CXXTryStmt * Create(const ASTContext &C, SourceLocation tryLoc, Stmt *tryBlock, ArrayRef< Stmt * > handlers)
CXXForRangeStmt - This represents C++0x [stmt.ranged]'s ranged for statement, represented as 'for (ra...
Expr - This represents one expression.
CXXTryStmt - A C++ try block, including all handlers.
Encodes a location in the source.
DeclStmt - Adaptor class for mixing declarations with statements and expressions. ...
const Decl * getSingleDecl() const
CXXForRangeStmt(DeclStmt *Range, DeclStmt *Begin, DeclStmt *End, Expr *Cond, Expr *Inc, DeclStmt *LoopVar, Stmt *Body, SourceLocation FL, SourceLocation CAL, SourceLocation CL, SourceLocation RPL)
QualType getCaughtType() const
DeclStmt * getRangeStmt()
VarDecl * getLoopVariable()
void * Allocate(size_t Size, unsigned Align=8) const
DeclStmt * getLoopVarStmt()
SourceLocation ColonLoc
Location of ':'.