Skip to content

Commit d37e648

Browse files
committed
Rename helper -> wrapper
1 parent 1fb2206 commit d37e648

File tree

8 files changed

+70
-70
lines changed

8 files changed

+70
-70
lines changed

clang/lib/CodeGen/CGCoroutine.cpp

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -182,22 +182,22 @@ static bool AwaitSuspendStmtCanThrow(const Stmt *S) {
182182
// auto && x = CommonExpr();
183183
// if (!x.await_ready()) {
184184
// llvm_coro_save();
185-
// llvm_coro_await_suspend(&x, frame, helper) (*)
185+
// llvm_coro_await_suspend(&x, frame, wrapper) (*)
186186
// llvm_coro_suspend(); (**)
187187
// }
188188
// x.await_resume();
189189
//
190190
// where the result of the entire expression is the result of x.await_resume()
191191
//
192192
// (*) llvm_coro_await_suspend_{void, bool, handle} is lowered to
193-
// helper(&x, frame) when it's certain not to interfere with
193+
// wrapper(&x, frame) when it's certain not to interfere with
194194
// coroutine transform. await_suspend expression is
195195
// asynchronous to the coroutine body and not all analyses
196196
// and transformations can handle it correctly at the moment.
197197
//
198-
// Helper function encapsulates x.await_suspend(...) call and looks like:
198+
// Wrapper function encapsulates x.await_suspend(...) call and looks like:
199199
//
200-
// auto __await_suspend_helper(auto& awaiter, void* frame) {
200+
// auto __await_suspend_wrapper(auto& awaiter, void* frame) {
201201
// std::coroutine_handle<> handle(frame);
202202
// return awaiter.await_suspend(handle);
203203
// }
@@ -253,7 +253,7 @@ static LValueOrRValue emitSuspendExpression(CodeGenFunction &CGF, CGCoroData &Co
253253
const auto AwaitSuspendCanThrow =
254254
AwaitSuspendStmtCanThrow(S.getSuspendExpr());
255255

256-
auto SuspendHelper = CodeGenFunction(CGF.CGM).generateAwaitSuspendHelper(
256+
auto SuspendWrapper = CodeGenFunction(CGF.CGM).generateAwaitSuspendWrapper(
257257
CGF.CurFn->getName(), Prefix, S);
258258

259259
llvm::CallBase *SuspendRet = nullptr;
@@ -263,12 +263,12 @@ static LValueOrRValue emitSuspendExpression(CodeGenFunction &CGF, CGCoroData &Co
263263
assert(CGF.CurCoro.Data && CGF.CurCoro.Data->CoroBegin &&
264264
"expected to be called in coroutine context");
265265

266-
SmallVector<llvm::Value *, 3> SuspendHelperCallArgs;
267-
SuspendHelperCallArgs.push_back(
266+
SmallVector<llvm::Value *, 3> SuspendIntrinsicCallArgs;
267+
SuspendIntrinsicCallArgs.push_back(
268268
CGF.getOrCreateOpaqueLValueMapping(S.getOpaqueValue()).getPointer(CGF));
269269

270-
SuspendHelperCallArgs.push_back(CGF.CurCoro.Data->CoroBegin);
271-
SuspendHelperCallArgs.push_back(SuspendHelper);
270+
SuspendIntrinsicCallArgs.push_back(CGF.CurCoro.Data->CoroBegin);
271+
SuspendIntrinsicCallArgs.push_back(SuspendWrapper);
272272

273273
const auto SuspendReturnType = S.getSuspendReturnType();
274274
llvm::Intrinsic::ID IID;
@@ -289,10 +289,10 @@ static LValueOrRValue emitSuspendExpression(CodeGenFunction &CGF, CGCoroData &Co
289289
// FIXME: add call attributes?
290290
if (AwaitSuspendCanThrow)
291291
SuspendRet =
292-
CGF.EmitCallOrInvoke(AwaitSuspendIntrinsic, SuspendHelperCallArgs);
292+
CGF.EmitCallOrInvoke(AwaitSuspendIntrinsic, SuspendIntrinsicCallArgs);
293293
else
294294
SuspendRet = CGF.EmitNounwindRuntimeCall(AwaitSuspendIntrinsic,
295-
SuspendHelperCallArgs);
295+
SuspendIntrinsicCallArgs);
296296

297297
assert(SuspendRet);
298298
CGF.CurCoro.InSuspendBlock = false;
@@ -415,10 +415,10 @@ static QualType getCoroutineSuspendExprReturnType(const ASTContext &Ctx,
415415
#endif
416416

417417
llvm::Function *
418-
CodeGenFunction::generateAwaitSuspendHelper(Twine const &CoroName,
419-
Twine const &SuspendPointName,
420-
CoroutineSuspendExpr const &S) {
421-
std::string FuncName = "__await_suspend_helper_";
418+
CodeGenFunction::generateAwaitSuspendWrapper(Twine const &CoroName,
419+
Twine const &SuspendPointName,
420+
CoroutineSuspendExpr const &S) {
421+
std::string FuncName = "__await_suspend_wrapper_";
422422
FuncName += CoroName.str();
423423
FuncName += '_';
424424
FuncName += SuspendPointName.str();
@@ -456,7 +456,7 @@ CodeGenFunction::generateAwaitSuspendHelper(Twine const &CoroName,
456456
auto AwaiterLValue =
457457
MakeNaturalAlignAddrLValue(AwaiterPtr, AwaiterDecl.getType());
458458

459-
CurAwaitSuspendHelper.FramePtr =
459+
CurAwaitSuspendWrapper.FramePtr =
460460
Builder.CreateLoad(GetAddrOfLocalVar(&FrameDecl));
461461

462462
// FIXME: mark as aliasing with frame?
@@ -474,7 +474,7 @@ CodeGenFunction::generateAwaitSuspendHelper(Twine const &CoroName,
474474
Builder.CreateStore(SuspendRet, ReturnValue);
475475
}
476476

477-
CurAwaitSuspendHelper.FramePtr = nullptr;
477+
CurAwaitSuspendWrapper.FramePtr = nullptr;
478478
FinishFunction();
479479
return Fn;
480480
}
@@ -976,8 +976,8 @@ RValue CodeGenFunction::EmitCoroutineIntrinsic(const CallExpr *E,
976976
return RValue::get(CurCoro.Data->CoroBegin);
977977
}
978978

979-
if (CurAwaitSuspendHelper.FramePtr) {
980-
return RValue::get(CurAwaitSuspendHelper.FramePtr);
979+
if (CurAwaitSuspendWrapper.FramePtr) {
980+
return RValue::get(CurAwaitSuspendWrapper.FramePtr);
981981
}
982982

983983
CGM.Error(E->getBeginLoc(), "this builtin expect that __builtin_coro_begin "

clang/lib/CodeGen/CodeGenFunction.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -350,24 +350,24 @@ class CodeGenFunction : public CodeGenTypeCache {
350350
return isCoroutine() && CurCoro.InSuspendBlock;
351351
}
352352

353-
// Holds FramePtr for await_suspend helper generation,
353+
// Holds FramePtr for await_suspend wrapper generation,
354354
// so that __builtin_coro_frame call can be lowered
355355
// directly to value of its second argument
356-
struct AwaitSuspendHelperInfo {
356+
struct AwaitSuspendWrapperInfo {
357357
llvm::Value *FramePtr = nullptr;
358358
};
359-
AwaitSuspendHelperInfo CurAwaitSuspendHelper;
359+
AwaitSuspendWrapperInfo CurAwaitSuspendWrapper;
360360

361-
// Generates helper function for `llvm.coro.await.suspend.*` intrinisics.
361+
// Generates wrapper function for `llvm.coro.await.suspend.*` intrinisics.
362362
// It encapsulates SuspendExpr in a function, to separate it's body
363363
// from the main coroutine to avoid miscompilations. Intrinisic
364364
// is lowered to this function call in CoroSplit pass
365365
// Function signature is:
366-
// <type> __await_suspend_helper_<name>(ptr %awaiter, ptr %hdl)
366+
// <type> __await_suspend_wrapper_<name>(ptr %awaiter, ptr %hdl)
367367
// where type is one of (void, i1, ptr)
368-
llvm::Function *generateAwaitSuspendHelper(Twine const &CoroName,
369-
Twine const &SuspendPointName,
370-
CoroutineSuspendExpr const &S);
368+
llvm::Function *generateAwaitSuspendWrapper(Twine const &CoroName,
369+
Twine const &SuspendPointName,
370+
CoroutineSuspendExpr const &S);
371371

372372
/// CurGD - The GlobalDecl for the current function being compiled.
373373
GlobalDecl CurGD;

clang/test/CodeGenCoroutines/coro-await.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ extern "C" void f0() {
7373
// ---------------------------
7474
// Call coro.await.suspend
7575
// ---------------------------
76-
// CHECK-NEXT: call void @llvm.coro.await.suspend.void(ptr %[[AWAITABLE]], ptr %[[FRAME]], ptr @__await_suspend_helper_f0_await)
76+
// CHECK-NEXT: call void @llvm.coro.await.suspend.void(ptr %[[AWAITABLE]], ptr %[[FRAME]], ptr @__await_suspend_wrapper_f0_await)
7777
// -------------------------
7878
// Generate a suspend point:
7979
// -------------------------
@@ -99,8 +99,8 @@ extern "C" void f0() {
9999
// CHECK: %[[FINALSP_ID:.+]] = call token @llvm.coro.save(
100100
// CHECK: call i8 @llvm.coro.suspend(token %[[FINALSP_ID]], i1 true)
101101

102-
// await suspend helper
103-
// CHECK: define{{.*}} @__await_suspend_helper_f0_await(ptr {{[^,]*}} %[[AWAITABLE_ARG:.+]], ptr {{[^,]*}} %[[FRAME_ARG:.+]])
102+
// Await suspend wrapper
103+
// CHECK: define{{.*}} @__await_suspend_wrapper_f0_await(ptr {{[^,]*}} %[[AWAITABLE_ARG:.+]], ptr {{[^,]*}} %[[FRAME_ARG:.+]])
104104
// CHECK: store ptr %[[AWAITABLE_ARG]], ptr %[[AWAITABLE_TMP:.+]],
105105
// CHECK: store ptr %[[FRAME_ARG]], ptr %[[FRAME_TMP:.+]],
106106
// CHECK: %[[AWAITABLE:.+]] = load ptr, ptr %[[AWAITABLE_TMP]]
@@ -149,7 +149,7 @@ extern "C" void f1(int) {
149149
// ---------------------------
150150
// Call coro.await.suspend
151151
// ---------------------------
152-
// CHECK-NEXT: %[[YES:.+]] = call i1 @llvm.coro.await.suspend.bool(ptr %[[AWAITABLE]], ptr %[[FRAME]], ptr @__await_suspend_helper_f1_yield)
152+
// CHECK-NEXT: %[[YES:.+]] = call i1 @llvm.coro.await.suspend.bool(ptr %[[AWAITABLE]], ptr %[[FRAME]], ptr @__await_suspend_wrapper_f1_yield)
153153
// -------------------------------------------
154154
// See if await_suspend decided not to suspend
155155
// -------------------------------------------
@@ -161,8 +161,8 @@ extern "C" void f1(int) {
161161
// CHECK: [[READY_BB]]:
162162
// CHECK: call void @_ZN13suspend_maybe12await_resumeEv(ptr {{[^,]*}} %[[AWAITABLE]])
163163

164-
// Await suspend helper
165-
// CHECK: define {{.*}} i1 @__await_suspend_helper_f1_yield(ptr {{[^,]*}} %[[AWAITABLE_ARG:.+]], ptr {{[^,]*}} %[[FRAME_ARG:.+]])
164+
// Await suspend wrapper
165+
// CHECK: define {{.*}} i1 @__await_suspend_wrapper_f1_yield(ptr {{[^,]*}} %[[AWAITABLE_ARG:.+]], ptr {{[^,]*}} %[[FRAME_ARG:.+]])
166166
// CHECK: store ptr %[[AWAITABLE_ARG]], ptr %[[AWAITABLE_TMP:.+]],
167167
// CHECK: store ptr %[[FRAME_ARG]], ptr %[[FRAME_TMP:.+]],
168168
// CHECK: %[[AWAITABLE:.+]] = load ptr, ptr %[[AWAITABLE_TMP]]
@@ -370,16 +370,16 @@ extern "C" void TestTailcall() {
370370
// ---------------------------
371371
// Call coro.await.suspend
372372
// ---------------------------
373-
// CHECK-NEXT: %[[RESUMED:.+]] = call ptr @llvm.coro.await.suspend.handle(ptr %[[AWAITABLE]], ptr %[[FRAME]], ptr @__await_suspend_helper_TestTailcall_await)
373+
// CHECK-NEXT: %[[RESUMED:.+]] = call ptr @llvm.coro.await.suspend.handle(ptr %[[AWAITABLE]], ptr %[[FRAME]], ptr @__await_suspend_wrapper_TestTailcall_await)
374374
// CHECK-NEXT: call void @llvm.coro.resume(ptr %[[RESUMED]])
375375
// CHECK-NEXT: %[[OUTCOME:.+]] = call i8 @llvm.coro.suspend(token %[[SUSPEND_ID]], i1 false)
376376
// CHECK-NEXT: switch i8 %[[OUTCOME]], label %[[RET_BB:.+]] [
377377
// CHECK-NEXT: i8 0, label %[[READY_BB]]
378378
// CHECK-NEXT: i8 1, label %{{.+}}
379379
// CHECK-NEXT: ]
380380

381-
// Await suspend helper
382-
// CHECK: define {{.*}} ptr @__await_suspend_helper_TestTailcall_await(ptr {{[^,]*}} %[[AWAITABLE_ARG:.+]], ptr {{[^,]*}} %[[FRAME_ARG:.+]])
381+
// Await suspend wrapper
382+
// CHECK: define {{.*}} ptr @__await_suspend_wrapper_TestTailcall_await(ptr {{[^,]*}} %[[AWAITABLE_ARG:.+]], ptr {{[^,]*}} %[[FRAME_ARG:.+]])
383383
// CHECK: store ptr %[[AWAITABLE_ARG]], ptr %[[AWAITABLE_TMP:.+]],
384384
// CHECK: store ptr %[[FRAME_ARG]], ptr %[[FRAME_TMP:.+]],
385385
// CHECK: %[[AWAITABLE:.+]] = load ptr, ptr %[[AWAITABLE_TMP]]

clang/test/CodeGenCoroutines/coro-dwarf.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,14 @@ void f_coro(int val, MoveOnly moParam, MoveAndCopy mcParam) {
7171
// CHECK: !{{[0-9]+}} = !DILocalVariable(name: "mcParam", arg: 3, scope: ![[SP]], file: !{{[0-9]+}}, line: {{[0-9]+}}, type: !{{[0-9]+}})
7272
// CHECK: !{{[0-9]+}} = !DILocalVariable(name: "__promise",
7373

74-
// CHECK: !{{[0-9]+}} = distinct !DISubprogram(linkageName: "__await_suspend_helper__Z6f_coroi8MoveOnly11MoveAndCopy_init"
74+
// CHECK: !{{[0-9]+}} = distinct !DISubprogram(linkageName: "__await_suspend_wrapper__Z6f_coroi8MoveOnly11MoveAndCopy_init"
7575
// CHECK-NEXT: !{{[0-9]+}} = !DIFile
7676
// CHECK-NEXT: !{{[0-9]+}} = !DISubroutineType
7777
// CHECK-NEXT: !{{[0-9]+}} = !DILocalVariable(arg: 1,
7878
// CHECK-NEXT: !{{[0-9]+}} = !DILocation
7979
// CHECK-NEXT: !{{[0-9]+}} = !DILocalVariable(arg: 2,
8080

81-
// CHECK: !{{[0-9]+}} = distinct !DISubprogram(linkageName: "__await_suspend_helper__Z6f_coroi8MoveOnly11MoveAndCopy_final"
81+
// CHECK: !{{[0-9]+}} = distinct !DISubprogram(linkageName: "__await_suspend_wrapper__Z6f_coroi8MoveOnly11MoveAndCopy_final"
8282
// CHECK-NEXT: !{{[0-9]+}} = !DILocalVariable(arg: 1,
8383
// CHECK-NEXT: !{{[0-9]+}} = !DILocation
8484
// CHECK-NEXT: !{{[0-9]+}} = !DILocalVariable(arg: 2,

clang/test/CodeGenCoroutines/pr65054.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,6 @@ MyTask FooBar() {
5555
// FRONTEND: attributes #[[address_attr]] = {{.*}}alwaysinline
5656

5757
// CHECK-O0: define{{.*}}@_Z6FooBarv.resume
58-
// CHECK-O0: call{{.*}}@__await_suspend_helper__Z6FooBarv_await(
58+
// CHECK-O0: call{{.*}}@__await_suspend_wrapper__Z6FooBarv_await(
5959
// CHECK-O0-NOT: store
6060
// CHECK-O0: ret void

llvm/docs/Coroutines.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1780,7 +1780,7 @@ The first argument is a pointer to `awaiter` object.
17801780

17811781
The second argument is a pointer to the current coroutine's frame.
17821782

1783-
The third argument is a pointer to the helper function encapsulating
1783+
The third argument is a pointer to the wrapper function encapsulating
17841784
`await-suspend` logic. Its signature must be
17851785

17861786
.. code-block:: llvm
@@ -1819,7 +1819,7 @@ Example:
18191819
%suspend = call i8 @llvm.coro.suspend(token %save, i1 false)
18201820
...
18211821
1822-
; helper function example
1822+
; wrapper function example
18231823
define void @await_suspend_function(ptr %awaiter, ptr %hdl)
18241824
entry:
18251825
%hdl.arg = ... ; construct std::coroutine_handle from %hdl
@@ -1862,7 +1862,7 @@ The first argument is a pointer to `awaiter` object.
18621862

18631863
The second argument is a pointer to the current coroutine's frame.
18641864

1865-
The third argument is a pointer to the helper function encapsulating
1865+
The third argument is a pointer to the wrapper function encapsulating
18661866
`await-suspend` logic. Its signature must be
18671867

18681868
.. code-block:: llvm
@@ -1909,7 +1909,7 @@ Example:
19091909
br i1 %resume, %await.suspend.bool, %await.ready
19101910
...
19111911
1912-
; helper function example
1912+
; wrapper function example
19131913
define i1 @await_suspend_function(ptr %awaiter, ptr %hdl)
19141914
entry:
19151915
%hdl.arg = ... ; construct std::coroutine_handle from %hdl
@@ -1952,7 +1952,7 @@ The first argument is a pointer to `awaiter` object.
19521952

19531953
The second argument is a pointer to the current coroutine's frame.
19541954

1955-
The third argument is a pointer to the helper function encapsulating
1955+
The third argument is a pointer to the wrapper function encapsulating
19561956
`await-suspend` logic. Its signature must be
19571957

19581958
.. code-block:: llvm
@@ -1996,7 +1996,7 @@ Example:
19961996
%suspend = call i8 @llvm.coro.suspend(token %save, i1 false)
19971997
...
19981998
1999-
; helper function example
1999+
; wrapper function example
20002000
define ptr @await_suspend_function(ptr %awaiter, ptr %hdl)
20012001
entry:
20022002
%hdl.arg = ... ; construct std::coroutine_handle from %hdl

llvm/lib/Transforms/Coroutines/CoroInstr.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,15 +80,15 @@ class LLVM_LIBRARY_VISIBILITY CoroAllocInst : public IntrinsicInst {
8080

8181
/// This represents the llvm.coro.await.suspend instruction.
8282
class LLVM_LIBRARY_VISIBILITY CoroAwaitSuspendInst : public CallBase {
83-
enum { AwaiterArg, FrameArg, HelperArg };
83+
enum { AwaiterArg, FrameArg, WrapperArg };
8484

8585
public:
8686
Value *getAwaiter() const { return getArgOperand(AwaiterArg); }
8787

8888
Value *getFrame() const { return getArgOperand(FrameArg); }
8989

90-
Function *getHelperFunction() const {
91-
return cast<Function>(getArgOperand(HelperArg));
90+
Function *getWrapperFunction() const {
91+
return cast<Function>(getArgOperand(WrapperArg));
9292
}
9393

9494
// Methods to support type inquiry through isa, cast, and dyn_cast:

llvm/lib/Transforms/Coroutines/CoroSplit.cpp

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -170,34 +170,34 @@ class CoroCloner {
170170
// FIXME:
171171
// Lower the intrinisc earlier if coroutine frame doesn't escape
172172
static void lowerAwaitSuspend(IRBuilder<> &Builder, CoroAwaitSuspendInst *CB) {
173-
auto Helper = CB->getHelperFunction();
173+
auto Wrapper = CB->getWrapperFunction();
174174
auto Awaiter = CB->getAwaiter();
175175
auto FramePtr = CB->getFrame();
176176

177177
Builder.SetInsertPoint(CB);
178178

179179
CallBase *NewCall = nullptr;
180180
if (auto Invoke = dyn_cast<InvokeInst>(CB)) {
181-
auto HelperInvoke =
182-
Builder.CreateInvoke(Helper, Invoke->getNormalDest(),
181+
auto WrapperInvoke =
182+
Builder.CreateInvoke(Wrapper, Invoke->getNormalDest(),
183183
Invoke->getUnwindDest(), {Awaiter, FramePtr});
184184

185-
HelperInvoke->setCallingConv(Invoke->getCallingConv());
185+
WrapperInvoke->setCallingConv(Invoke->getCallingConv());
186186
std::copy(Invoke->bundle_op_info_begin(), Invoke->bundle_op_info_end(),
187-
HelperInvoke->bundle_op_info_begin());
187+
WrapperInvoke->bundle_op_info_begin());
188188
AttributeList NewAttributes =
189189
Invoke->getAttributes().removeParamAttributes(Invoke->getContext(), 2);
190-
HelperInvoke->setAttributes(NewAttributes);
191-
HelperInvoke->setDebugLoc(Invoke->getDebugLoc());
192-
NewCall = HelperInvoke;
190+
WrapperInvoke->setAttributes(NewAttributes);
191+
WrapperInvoke->setDebugLoc(Invoke->getDebugLoc());
192+
NewCall = WrapperInvoke;
193193
} else if (auto Call = dyn_cast<CallInst>(CB)) {
194-
auto HelperCall = Builder.CreateCall(Helper, {Awaiter, FramePtr});
194+
auto WrapperCall = Builder.CreateCall(Wrapper, {Awaiter, FramePtr});
195195

196196
AttributeList NewAttributes =
197197
Call->getAttributes().removeParamAttributes(Call->getContext(), 2);
198-
HelperCall->setAttributes(NewAttributes);
199-
HelperCall->setDebugLoc(Call->getDebugLoc());
200-
NewCall = HelperCall;
198+
WrapperCall->setAttributes(NewAttributes);
199+
WrapperCall->setDebugLoc(Call->getDebugLoc());
200+
NewCall = WrapperCall;
201201
} else {
202202
llvm_unreachable("Unexpected coro_await_suspend invocation method");
203203
}
@@ -1420,18 +1420,18 @@ static bool hasCallsBetween(Instruction *Save, Instruction *ResumeOrDestroy) {
14201420
return false;
14211421
}
14221422

1423-
// Check if await-suspend helper is "simple".
1423+
// Check if await-suspend wrapper is "simple".
14241424
// The conditions are:
1425-
// 1. The return result is exactly coroutine frame parameter, passed to helper
1426-
// 2. There are no calls between any of the returns and helper entry that could
1425+
// 1. The return result is exactly coroutine frame parameter, passed to wrapper
1426+
// 2. There are no calls between any of the returns and wrapper entry that could
14271427
// resume or destroy it
14281428
// FIXME: perform more sophisiticated analysis?
1429-
static bool isSimpleHelper(CoroAwaitSuspendInst *AWS) {
1430-
auto Helper = AWS->getHelperFunction();
1429+
static bool isSimpleWrapper(CoroAwaitSuspendInst *AWS) {
1430+
auto Wrapper = AWS->getWrapperFunction();
14311431

14321432
SmallVector<ReturnInst *, 4> Rets;
14331433

1434-
for (auto &BB : *Helper) {
1434+
for (auto &BB : *Wrapper) {
14351435
if (BB.empty())
14361436
continue;
14371437
auto terminator = BB.getTerminator();
@@ -1443,8 +1443,8 @@ static bool isSimpleHelper(CoroAwaitSuspendInst *AWS) {
14431443

14441444
// FIXME: get rid of magical constant
14451445
for (auto Ret : Rets)
1446-
if (Ret->getReturnValue() != Helper->getArg(1) ||
1447-
hasCallsBetween(Helper->getEntryBlock().getFirstNonPHI(), Ret))
1446+
if (Ret->getReturnValue() != Wrapper->getArg(1) ||
1447+
hasCallsBetween(Wrapper->getEntryBlock().getFirstNonPHI(), Ret))
14481448
return false;
14491449

14501450
return true;
@@ -1476,13 +1476,13 @@ static bool simplifySuspendPoint(CoroSuspendInst *Suspend,
14761476
auto Frame = SubFn->getFrame();
14771477

14781478
// Check that frame directly always refers to the current coroutine,
1479-
// either directly or via helper
1479+
// either directly or via wrapper
14801480
if (Frame != CoroBegin) {
14811481
auto *AWS = dyn_cast<CoroAwaitSuspendInst>(Frame);
14821482
if (!AWS)
14831483
return false;
14841484

1485-
if (AWS->getFrame() != CoroBegin || !isSimpleHelper(AWS))
1485+
if (AWS->getFrame() != CoroBegin || !isSimpleWrapper(AWS))
14861486
return false;
14871487
}
14881488

0 commit comments

Comments
 (0)