forked from OSchip/llvm-project
Coroutines: avoid use of deprecated CreateLoad and CreateCall methods
Summary: Patch originally by Tim Northover Reviewers: t.p.northover Subscribers: EricWF, hiraditya, modocache, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D74674
This commit is contained in:
parent
bf197304a6
commit
464d4cf7e6
|
@ -95,7 +95,7 @@ void Lowerer::lowerCoroDone(IntrinsicInst *II) {
|
|||
|
||||
Builder.SetInsertPoint(II);
|
||||
auto *BCI = Builder.CreateBitCast(Operand, FramePtrTy);
|
||||
auto *Load = Builder.CreateLoad(BCI);
|
||||
auto *Load = Builder.CreateLoad(FrameTy, BCI);
|
||||
auto *Cond = Builder.CreateICmpEQ(Load, NullPtr);
|
||||
|
||||
II->replaceAllUsesWith(Cond);
|
||||
|
|
|
@ -784,7 +784,7 @@ static Instruction *insertSpills(const SpillInfo &Spills, coro::Shape &Shape) {
|
|||
"Coroutines cannot handle copying of array allocas yet");
|
||||
|
||||
auto *G = GetFramePointer(P.second, A);
|
||||
auto *Value = Builder.CreateLoad(A);
|
||||
auto *Value = Builder.CreateLoad(A->getAllocatedType(), A);
|
||||
Builder.CreateStore(Value, G);
|
||||
}
|
||||
}
|
||||
|
@ -1166,7 +1166,7 @@ static Value *emitGetSwiftErrorValue(IRBuilder<> &Builder, Type *ValueTy,
|
|||
auto FnTy = FunctionType::get(ValueTy, {}, false);
|
||||
auto Fn = ConstantPointerNull::get(FnTy->getPointerTo());
|
||||
|
||||
auto Call = Builder.CreateCall(Fn, {});
|
||||
auto Call = Builder.CreateCall(FnTy, Fn, {});
|
||||
Shape.SwiftErrorOps.push_back(Call);
|
||||
|
||||
return Call;
|
||||
|
@ -1182,7 +1182,7 @@ static Value *emitSetSwiftErrorValue(IRBuilder<> &Builder, Value *V,
|
|||
{V->getType()}, false);
|
||||
auto Fn = ConstantPointerNull::get(FnTy->getPointerTo());
|
||||
|
||||
auto Call = Builder.CreateCall(Fn, { V });
|
||||
auto Call = Builder.CreateCall(FnTy, Fn, { V });
|
||||
Shape.SwiftErrorOps.push_back(Call);
|
||||
|
||||
return Call;
|
||||
|
|
|
@ -630,7 +630,7 @@ Value *CoroCloner::deriveNewFramePointer() {
|
|||
// Otherwise, load the real frame from the opaque storage.
|
||||
auto FramePtrPtr =
|
||||
Builder.CreateBitCast(NewStorage, FramePtrTy->getPointerTo());
|
||||
return Builder.CreateLoad(FramePtrPtr);
|
||||
return Builder.CreateLoad(FramePtrTy, FramePtrPtr);
|
||||
}
|
||||
}
|
||||
llvm_unreachable("bad ABI");
|
||||
|
|
Loading…
Reference in New Issue