diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2021-07-29 20:15:26 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2021-07-29 20:15:26 +0000 |
commit | 344a3780b2e33f6ca763666c380202b18aab72a3 (patch) | |
tree | f0b203ee6eb71d7fdd792373e3c81eb18d6934dd /llvm/lib/Transforms/Coroutines/Coroutines.cpp | |
parent | b60736ec1405bb0a8dd40989f67ef4c93da068ab (diff) |
vendor/llvm-project/llvmorg-13-init-16847-g88e66fa60ae5vendor/llvm-project/llvmorg-12.0.1-rc2-0-ge7dac564cd0evendor/llvm-project/llvmorg-12.0.1-0-gfed41342a82f
Diffstat (limited to 'llvm/lib/Transforms/Coroutines/Coroutines.cpp')
-rw-r--r-- | llvm/lib/Transforms/Coroutines/Coroutines.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/llvm/lib/Transforms/Coroutines/Coroutines.cpp b/llvm/lib/Transforms/Coroutines/Coroutines.cpp index 6699a5c46313..ae2d9e192c87 100644 --- a/llvm/lib/Transforms/Coroutines/Coroutines.cpp +++ b/llvm/lib/Transforms/Coroutines/Coroutines.cpp @@ -126,6 +126,7 @@ static bool isCoroutineIntrinsicName(StringRef Name) { "llvm.coro.alloc", "llvm.coro.async.context.alloc", "llvm.coro.async.context.dealloc", + "llvm.coro.async.size.replace", "llvm.coro.async.store_resume", "llvm.coro.begin", "llvm.coro.destroy", @@ -360,7 +361,7 @@ void coro::Shape::buildFrom(Function &F) { // Replace all coro.ends with unreachable instruction. for (AnyCoroEndInst *CE : CoroEnds) - changeToUnreachable(CE, /*UseLLVMTrap=*/false); + changeToUnreachable(CE); return; } @@ -399,11 +400,7 @@ void coro::Shape::buildFrom(Function &F) { this->AsyncLowering.ContextAlignment = AsyncId->getStorageAlignment().value(); this->AsyncLowering.AsyncFuncPointer = AsyncId->getAsyncFunctionPointer(); - auto &Context = F.getContext(); - auto *Int8PtrTy = Type::getInt8PtrTy(Context); - auto *VoidTy = Type::getVoidTy(Context); - this->AsyncLowering.AsyncFuncTy = - FunctionType::get(VoidTy, {Int8PtrTy, Int8PtrTy, Int8PtrTy}, false); + this->AsyncLowering.AsyncCC = F.getCallingConv(); break; }; case Intrinsic::coro_id_retcon: @@ -700,7 +697,7 @@ void CoroIdAsyncInst::checkWellFormed() const { static void checkAsyncContextProjectFunction(const Instruction *I, Function *F) { - auto *FunTy = cast<FunctionType>(F->getType()->getPointerElementType()); + auto *FunTy = cast<FunctionType>(F->getValueType()); if (!FunTy->getReturnType()->isPointerTy() || !FunTy->getReturnType()->getPointerElementType()->isIntegerTy(8)) fail(I, |