17 using namespace clang;
21 return ExceptionDecl->
getType();
27 const size_t Size = totalSizeToAlloc<Stmt *>(handlers.size() + 1);
28 void *Mem = C.Allocate(Size,
alignof(
CXXTryStmt));
29 return new (Mem)
CXXTryStmt(tryLoc, tryBlock, handlers);
33 unsigned numHandlers) {
34 const size_t Size = totalSizeToAlloc<Stmt *>(numHandlers + 1);
35 void *Mem = C.Allocate(Size,
alignof(
CXXTryStmt));
36 return new (Mem)
CXXTryStmt(Empty, numHandlers);
41 :
Stmt(CXXTryStmtClass), TryLoc(tryLoc), NumHandlers(handlers.size()) {
42 Stmt **Stmts = getStmts();
44 std::copy(handlers.begin(), handlers.end(), Stmts + 1);
53 :
Stmt(CXXForRangeStmtClass), ForLoc(FL), CoawaitLoc(CAL), ColonLoc(CL),
55 SubExprs[INIT] = Init;
56 SubExprs[RANGE] = Range;
57 SubExprs[BEGINSTMT] = BeginStmt;
58 SubExprs[ENDSTMT] = EndStmt;
59 SubExprs[COND] = Cond;
61 SubExprs[LOOPVAR] = LoopVar;
62 SubExprs[BODY] = Body;
68 assert(RangeDecl &&
"for-range should have a single var decl");
78 assert(LV &&
"No loop variable in CXXForRangeStmt");
79 return cast<VarDecl>(LV);
89 CoroutineBodyStmt::FirstParamMove + Args.
ParamMoves.size());
98 CoroutineBodyStmt::FirstParamMove + NumParams);
102 Result->NumParams = NumParams;
103 auto *ParamBegin = Result->getStoredStmts() + SubStmt::FirstParamMove;
104 std::uninitialized_fill(ParamBegin, ParamBegin + NumParams,
105 static_cast<Stmt *
>(
nullptr));
110 :
Stmt(CoroutineBodyStmtClass), NumParams(Args.ParamMoves.size()) {
111 Stmt **SubStmts = getStoredStmts();
112 SubStmts[CoroutineBodyStmt::Body] = Args.
Body;
113 SubStmts[CoroutineBodyStmt::Promise] = Args.
Promise;
115 SubStmts[CoroutineBodyStmt::FinalSuspend] = Args.
FinalSuspend;
116 SubStmts[CoroutineBodyStmt::OnException] = Args.
OnException;
117 SubStmts[CoroutineBodyStmt::OnFallthrough] = Args.
OnFallthrough;
118 SubStmts[CoroutineBodyStmt::Allocate] = Args.
Allocate;
119 SubStmts[CoroutineBodyStmt::Deallocate] = Args.
Deallocate;
120 SubStmts[CoroutineBodyStmt::ReturnValue] = Args.
ReturnValue;
121 SubStmts[CoroutineBodyStmt::ReturnStmt] = Args.
ReturnStmt;
122 SubStmts[CoroutineBodyStmt::ReturnStmtOnAllocFailure] =