[llvm] 83208cd - [CallSite removal][CodeGen] Use CallBase instead of ImmutableCallSite in WinEHPrepare. NFC
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 13 00:20:38 PDT 2020
Author: Craig Topper
Date: 2020-04-13T00:19:27-07:00
New Revision: 83208cdd57d1cc8a34b8de5fb2e5aa5bd7a84ee1
URL: https://github.com/llvm/llvm-project/commit/83208cdd57d1cc8a34b8de5fb2e5aa5bd7a84ee1
DIFF: https://github.com/llvm/llvm-project/commit/83208cdd57d1cc8a34b8de5fb2e5aa5bd7a84ee1.diff
LOG: [CallSite removal][CodeGen] Use CallBase instead of ImmutableCallSite in WinEHPrepare. NFC
Added:
Modified:
llvm/lib/CodeGen/WinEHPrepare.cpp
Removed:
################################################################################
diff --git a/llvm/lib/CodeGen/WinEHPrepare.cpp b/llvm/lib/CodeGen/WinEHPrepare.cpp
index 87958a738c67..d6c049f3d0da 100644
--- a/llvm/lib/CodeGen/WinEHPrepare.cpp
+++ b/llvm/lib/CodeGen/WinEHPrepare.cpp
@@ -942,12 +942,12 @@ void WinEHPrepare::removeImplausibleInstructions(Function &F) {
for (BasicBlock *BB : BlocksInFunclet) {
for (Instruction &I : *BB) {
- CallSite CS(&I);
- if (!CS)
+ auto *CB = dyn_cast<CallBase>(&I);
+ if (!CB)
continue;
Value *FuncletBundleOperand = nullptr;
- if (auto BU = CS.getOperandBundle(LLVMContext::OB_funclet))
+ if (auto BU = CB->getOperandBundle(LLVMContext::OB_funclet))
FuncletBundleOperand = BU->Inputs.front();
if (FuncletBundleOperand == FuncletPad)
@@ -955,13 +955,13 @@ void WinEHPrepare::removeImplausibleInstructions(Function &F) {
// Skip call sites which are nounwind intrinsics or inline asm.
auto *CalledFn =
- dyn_cast<Function>(CS.getCalledValue()->stripPointerCasts());
- if (CalledFn && ((CalledFn->isIntrinsic() && CS.doesNotThrow()) ||
- CS.isInlineAsm()))
+ dyn_cast<Function>(CB->getCalledValue()->stripPointerCasts());
+ if (CalledFn && ((CalledFn->isIntrinsic() && CB->doesNotThrow()) ||
+ CB->isInlineAsm()))
continue;
// This call site was not part of this funclet, remove it.
- if (CS.isInvoke()) {
+ if (isa<InvokeInst>(CB)) {
// Remove the unwind edge if it was an invoke.
removeUnwindEdge(BB);
// Get a pointer to the new call.
More information about the llvm-commits
mailing list