diff options
author | Owen Anderson <resistor@mac.com> | 2008-09-05 23:36:01 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2008-09-05 23:36:01 +0000 |
commit | 6e6074508c2f781c3e52dfe0e301cb1c7f395a91 (patch) | |
tree | 78acc35e61261c50375bff374e13984acdcdce54 /lib/Transforms/Utils/InlineFunction.cpp | |
parent | d0c0fae63bbbdb2d26e62736f0654bfdc5193ccc (diff) |
Revert r55859. This is breaking the build in the abscence of its companion commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55865 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Utils/InlineFunction.cpp')
-rw-r--r-- | lib/Transforms/Utils/InlineFunction.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/lib/Transforms/Utils/InlineFunction.cpp b/lib/Transforms/Utils/InlineFunction.cpp index b0e70bb89a..cb9c28dcab 100644 --- a/lib/Transforms/Utils/InlineFunction.cpp +++ b/lib/Transforms/Utils/InlineFunction.cpp @@ -143,18 +143,16 @@ static void HandleInlinedInvoke(InvokeInst *II, BasicBlock *FirstNewBlock, /// UpdateCallGraphAfterInlining - Once we have cloned code over from a callee /// into the caller, update the specified callgraph to reflect the changes we /// made. Note that it's possible that not all code was copied over, so only -/// some edges of the callgraph may remain. -static void UpdateCallGraphAfterInlining(CallSite CS, +/// some edges of the callgraph will be remain. +static void UpdateCallGraphAfterInlining(const Function *Caller, + const Function *Callee, Function::iterator FirstNewBlock, DenseMap<const Value*, Value*> &ValueMap, CallGraph &CG) { - const Function *Caller = CS.getInstruction()->getParent()->getParent(); - const Function *Callee = CS.getCalledFunction(); - // Update the call graph by deleting the edge from Callee to Caller CallGraphNode *CalleeNode = CG[Callee]; CallGraphNode *CallerNode = CG[Caller]; - CallerNode->removeCallEdgeFor(CS); + CallerNode->removeCallEdgeTo(CalleeNode); // Since we inlined some uninlined call sites in the callee into the caller, // add edges from the caller to all of the callees of the callee. @@ -304,7 +302,8 @@ bool llvm::InlineFunction(CallSite CS, CallGraph *CG, const TargetData *TD) { // Update the callgraph if requested. if (CG) - UpdateCallGraphAfterInlining(CS, FirstNewBlock, ValueMap, *CG); + UpdateCallGraphAfterInlining(Caller, CalledFunc, FirstNewBlock, ValueMap, + *CG); } // If there are any alloca instructions in the block that used to be the entry |