[Coroutines] Avoid pointer element access for resume function type

For switch ABI, the function type is always "void (%frame*)", so
just hardcode that rather than fetching it from a pointer element
type.
This commit is contained in:
Nikita Popov 2022-03-09 14:45:24 +01:00
parent acf77bd2fd
commit e81f566de6
1 changed files with 3 additions and 4 deletions

View File

@ -210,10 +210,9 @@ struct LLVM_LIBRARY_VISIBILITY Shape {
FunctionType *getResumeFunctionType() const {
switch (ABI) {
case coro::ABI::Switch: {
auto *FnPtrTy = getSwitchResumePointerType();
return cast<FunctionType>(FnPtrTy->getPointerElementType());
}
case coro::ABI::Switch:
return FunctionType::get(Type::getVoidTy(FrameTy->getContext()),
FrameTy->getPointerTo(), /*IsVarArg*/false);
case coro::ABI::Retcon:
case coro::ABI::RetconOnce:
return RetconLowering.ResumePrototype->getFunctionType();