summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/IPO
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Transforms/IPO')
-rw-r--r--llvm/lib/Transforms/IPO/ArgumentPromotion.cpp4
-rw-r--r--llvm/lib/Transforms/IPO/Inliner.cpp2
-rw-r--r--llvm/lib/Transforms/IPO/PruneEH.cpp8
3 files changed, 8 insertions, 6 deletions
diff --git a/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp b/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp
index dbbe03d1dac..5f994625f19 100644
--- a/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp
+++ b/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp
@@ -1104,7 +1104,9 @@ bool ArgPromotion::runOnSCC(CallGraphSCC &SCC) {
CallGraphNode *NewCalleeNode =
CG.getOrInsertFunction(NewCS.getCalledFunction());
CallGraphNode *CallerNode = CG[Caller];
- CallerNode->replaceCallEdge(OldCS, NewCS, NewCalleeNode);
+ CallerNode->replaceCallEdge(*cast<CallBase>(OldCS.getInstruction()),
+ *cast<CallBase>(NewCS.getInstruction()),
+ NewCalleeNode);
};
const TargetTransformInfo &TTI =
diff --git a/llvm/lib/Transforms/IPO/Inliner.cpp b/llvm/lib/Transforms/IPO/Inliner.cpp
index 4047c0acd19..f6e8b5344f5 100644
--- a/llvm/lib/Transforms/IPO/Inliner.cpp
+++ b/llvm/lib/Transforms/IPO/Inliner.cpp
@@ -671,7 +671,7 @@ inlineCallsImpl(CallGraphSCC &SCC, CallGraph &CG,
LLVM_DEBUG(dbgs() << " -> Deleting dead call: " << *Instr << "\n");
// Update the call graph by deleting the edge from Callee to Caller.
setInlineRemark(CS, "trivially dead");
- CG[Caller]->removeCallEdgeFor(CS);
+ CG[Caller]->removeCallEdgeFor(*cast<CallBase>(CS.getInstruction()));
Instr->eraseFromParent();
++NumCallsDeleted;
} else {
diff --git a/llvm/lib/Transforms/IPO/PruneEH.cpp b/llvm/lib/Transforms/IPO/PruneEH.cpp
index ef7b43e8b55..cb3915dfb67 100644
--- a/llvm/lib/Transforms/IPO/PruneEH.cpp
+++ b/llvm/lib/Transforms/IPO/PruneEH.cpp
@@ -242,12 +242,12 @@ static void DeleteBasicBlock(BasicBlock *BB, CallGraph &CG) {
break;
}
- if (auto CS = CallSite (&*I)) {
- const Function *Callee = CS.getCalledFunction();
+ if (auto *Call = dyn_cast<CallBase>(&*I)) {
+ const Function *Callee = Call->getCalledFunction();
if (!Callee || !Intrinsic::isLeaf(Callee->getIntrinsicID()))
- CGN->removeCallEdgeFor(CS);
+ CGN->removeCallEdgeFor(*Call);
else if (!Callee->isIntrinsic())
- CGN->removeCallEdgeFor(CS);
+ CGN->removeCallEdgeFor(*Call);
}
if (!I->use_empty())
OpenPOWER on IntegriCloud