21 return ExceptionDecl->
getType();
28 const size_t Size = totalSizeToAlloc<Stmt *>(handlers.size() + 1);
30 return new (Mem)
CXXTryStmt(tryLoc, tryBlock, handlers);
34 unsigned numHandlers) {
35 const size_t Size = totalSizeToAlloc<Stmt *>(numHandlers + 1);
42 :
Stmt(CXXTryStmtClass), TryLoc(tryLoc), NumHandlers(handlers.size()) {
43 Stmt **Stmts = getStmts();
45 std::copy(handlers.begin(), handlers.end(), Stmts + 1);
54 :
Stmt(CXXForRangeStmtClass), ForLoc(FL), CoawaitLoc(CAL), ColonLoc(CL),
56 SubExprs[INIT] =
Init;
57 SubExprs[RANGE] =
Range;
58 SubExprs[BEGINSTMT] = BeginStmt;
59 SubExprs[ENDSTMT] = EndStmt;
60 SubExprs[COND] = Cond;
62 SubExprs[LOOPVAR] = LoopVar;
63 SubExprs[BODY] = Body;
69 assert(RangeDecl &&
"for-range should have a single var decl");
79 assert(LV &&
"No loop variable in CXXForRangeStmt");
80 return cast<VarDecl>(LV);
89 std::size_t Size = totalSizeToAlloc<Stmt *>(
90 CoroutineBodyStmt::FirstParamMove + Args.
ParamMoves.size());
98 std::size_t Size = totalSizeToAlloc<Stmt *>(
99 CoroutineBodyStmt::FirstParamMove + NumParams);
103 Result->NumParams = NumParams;
104 auto *ParamBegin =
Result->getStoredStmts() + SubStmt::FirstParamMove;
105 std::uninitialized_fill(ParamBegin, ParamBegin + NumParams,
106 static_cast<Stmt *
>(
nullptr));
111 :
Stmt(CoroutineBodyStmtClass), NumParams(Args.ParamMoves.size()) {
112 Stmt **SubStmts = getStoredStmts();
113 SubStmts[CoroutineBodyStmt::Body] = Args.
Body;
114 SubStmts[CoroutineBodyStmt::Promise] = Args.
Promise;
116 SubStmts[CoroutineBodyStmt::FinalSuspend] = Args.
FinalSuspend;
117 SubStmts[CoroutineBodyStmt::OnException] = Args.
OnException;
118 SubStmts[CoroutineBodyStmt::OnFallthrough] = Args.
OnFallthrough;
119 SubStmts[CoroutineBodyStmt::Allocate] = Args.
Allocate;
120 SubStmts[CoroutineBodyStmt::Deallocate] = Args.
Deallocate;
121 SubStmts[CoroutineBodyStmt::ResultDecl] = Args.
ResultDecl;
122 SubStmts[CoroutineBodyStmt::ReturnValue] = Args.
ReturnValue;
123 SubStmts[CoroutineBodyStmt::ReturnStmt] = Args.
ReturnStmt;
124 SubStmts[CoroutineBodyStmt::ReturnStmtOnAllocFailure] =
Defines the clang::ASTContext interface.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
QualType getCaughtType() const
CXXForRangeStmt - This represents C++0x [stmt.ranged]'s ranged for statement, represented as 'for (ra...
CXXForRangeStmt(Stmt *InitStmt, DeclStmt *Range, DeclStmt *Begin, DeclStmt *End, Expr *Cond, Expr *Inc, DeclStmt *LoopVar, Stmt *Body, SourceLocation FL, SourceLocation CAL, SourceLocation CL, SourceLocation RPL)
DeclStmt * getLoopVarStmt()
DeclStmt * getRangeStmt()
VarDecl * getLoopVariable()
CXXTryStmt - A C++ try block, including all handlers.
static CXXTryStmt * Create(const ASTContext &C, SourceLocation tryLoc, CompoundStmt *tryBlock, ArrayRef< Stmt * > handlers)
CompoundStmt - This represents a group of statements like { stmt stmt }.
Represents the body of a coroutine.
static CoroutineBodyStmt * Create(const ASTContext &C, CtorArgs const &Args)
ArrayRef< Stmt const * > getParamMoves() const
DeclStmt - Adaptor class for mixing declarations with statements and expressions.
const Decl * getSingleDecl() const
Decl - This represents one declaration (or definition), e.g.
This represents one expression.
A (possibly-)qualified type.
Encodes a location in the source.
Stmt - This represents one statement.
Represents a variable declaration or definition.
const Expr * getInit() const
The JSON file list parser is used to communicate input to InstallAPI.
@ Result
The result type of a method or function.
Stmt * ReturnStmtOnAllocFailure
ArrayRef< Stmt * > ParamMoves
A placeholder type used to construct an empty shell of a type, that will be filled in later (e....