Skip to content

Commit 83208cd

Browse files
committed
[CallSite removal][CodeGen] Use CallBase instead of ImmutableCallSite in WinEHPrepare. NFC
1 parent 42487ea commit 83208cd

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

llvm/lib/CodeGen/WinEHPrepare.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -942,26 +942,26 @@ void WinEHPrepare::removeImplausibleInstructions(Function &F) {
942942

943943
for (BasicBlock *BB : BlocksInFunclet) {
944944
for (Instruction &I : *BB) {
945-
CallSite CS(&I);
946-
if (!CS)
945+
auto *CB = dyn_cast<CallBase>(&I);
946+
if (!CB)
947947
continue;
948948

949949
Value *FuncletBundleOperand = nullptr;
950-
if (auto BU = CS.getOperandBundle(LLVMContext::OB_funclet))
950+
if (auto BU = CB->getOperandBundle(LLVMContext::OB_funclet))
951951
FuncletBundleOperand = BU->Inputs.front();
952952

953953
if (FuncletBundleOperand == FuncletPad)
954954
continue;
955955

956956
// Skip call sites which are nounwind intrinsics or inline asm.
957957
auto *CalledFn =
958-
dyn_cast<Function>(CS.getCalledValue()->stripPointerCasts());
959-
if (CalledFn && ((CalledFn->isIntrinsic() && CS.doesNotThrow()) ||
960-
CS.isInlineAsm()))
958+
dyn_cast<Function>(CB->getCalledValue()->stripPointerCasts());
959+
if (CalledFn && ((CalledFn->isIntrinsic() && CB->doesNotThrow()) ||
960+
CB->isInlineAsm()))
961961
continue;
962962

963963
// This call site was not part of this funclet, remove it.
964-
if (CS.isInvoke()) {
964+
if (isa<InvokeInst>(CB)) {
965965
// Remove the unwind edge if it was an invoke.
966966
removeUnwindEdge(BB);
967967
// Get a pointer to the new call.

0 commit comments

Comments
 (0)