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:
Tim Northover 2019-12-17 10:07:03 +00:00 committed by Nicolai Hähnle
parent bf197304a6
commit 464d4cf7e6
3 changed files with 5 additions and 5 deletions

View File

@ -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);

View File

@ -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;

View File

@ -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");