Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions clang/lib/CodeGen/CGCoroutine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,9 @@ CodeGenFunction::generateAwaitSuspendWrapper(Twine const &CoroName,

FunctionArgList args;

ImplicitParamDecl AwaiterDecl(C, C.VoidPtrTy, ImplicitParamKind::Other);
QualType AwaiterType = S.getOpaqueValue()->getType();
ImplicitParamDecl AwaiterDecl(C, C.getPointerType(AwaiterType),
ImplicitParamKind::Other);
ImplicitParamDecl FrameDecl(C, C.VoidPtrTy, ImplicitParamKind::Other);
QualType ReturnTy = S.getSuspendExpr()->getType();

Expand All @@ -449,8 +451,7 @@ CodeGenFunction::generateAwaitSuspendWrapper(Twine const &CoroName,

// FIXME: add TBAA metadata to the loads
llvm::Value *AwaiterPtr = Builder.CreateLoad(GetAddrOfLocalVar(&AwaiterDecl));
auto AwaiterLValue =
MakeNaturalAlignAddrLValue(AwaiterPtr, AwaiterDecl.getType());
auto AwaiterLValue = MakeNaturalAlignAddrLValue(AwaiterPtr, AwaiterType);

CurAwaitSuspendWrapper.FramePtr =
Builder.CreateLoad(GetAddrOfLocalVar(&FrameDecl));
Expand Down