Skip to content

Commit 164998d

Browse files
committed
Rename StmtCanThrow
1 parent ef5149f commit 164998d

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

clang/lib/CodeGen/CGCoroutine.cpp

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ static bool FunctionCanThrow(const FunctionDecl *D) {
141141
Proto->canThrow() != CT_Cannot;
142142
}
143143

144-
static bool ResumeStmtCanThrow(const Stmt *S) {
144+
static bool StmtCanThrow(const Stmt *S) {
145145
if (const auto *CE = dyn_cast<CallExpr>(S)) {
146146
const auto *Callee = CE->getDirectCallee();
147147
if (!Callee)
@@ -167,16 +167,12 @@ static bool ResumeStmtCanThrow(const Stmt *S) {
167167
}
168168

169169
for (const auto *child : S->children())
170-
if (ResumeStmtCanThrow(child))
170+
if (StmtCanThrow(child))
171171
return true;
172172

173173
return false;
174174
}
175175

176-
static bool AwaitSuspendStmtCanThrow(const Stmt *S) {
177-
return ResumeStmtCanThrow(S);
178-
}
179-
180176
// Emit suspend expression which roughly looks like:
181177
//
182178
// auto && x = CommonExpr();
@@ -282,8 +278,7 @@ static LValueOrRValue emitSuspendExpression(CodeGenFunction &CGF, CGCoroData &Co
282278

283279
llvm::Function *AwaitSuspendIntrinsic = CGF.CGM.getIntrinsic(AwaitSuspendIID);
284280

285-
const auto AwaitSuspendCanThrow =
286-
AwaitSuspendStmtCanThrow(S.getSuspendExpr());
281+
const auto AwaitSuspendCanThrow = StmtCanThrow(S.getSuspendExpr());
287282

288283
llvm::CallBase *SuspendRet = nullptr;
289284
// FIXME: add call attributes?
@@ -343,7 +338,7 @@ static LValueOrRValue emitSuspendExpression(CodeGenFunction &CGF, CGCoroData &Co
343338
// is marked as 'noexcept', we avoid generating this additional IR.
344339
CXXTryStmt *TryStmt = nullptr;
345340
if (Coro.ExceptionHandler && Kind == AwaitKind::Init &&
346-
ResumeStmtCanThrow(S.getResumeExpr())) {
341+
StmtCanThrow(S.getResumeExpr())) {
347342
Coro.ResumeEHVar =
348343
CGF.CreateTempAlloca(Builder.getInt1Ty(), Prefix + Twine("resume.eh"));
349344
Builder.CreateFlagStore(true, Coro.ResumeEHVar);

0 commit comments

Comments
 (0)