diff options
| author | Dale Johannesen <dalej@apple.com> | 2009-01-13 22:43:37 +0000 |
|---|---|---|
| committer | Dale Johannesen <dalej@apple.com> | 2009-01-13 22:43:37 +0000 |
| commit | 0aeabdff57adf92c16380048eed8b6c7bf0caab6 (patch) | |
| tree | 207f96a850342a4ee3f355e8a2d7dd6e7455e112 /llvm/lib/Transforms/Utils | |
| parent | 7cbdcc25d4515ce5ca8a140861ab418ce2a5b314 (diff) | |
| download | bcm5719-llvm-0aeabdff57adf92c16380048eed8b6c7bf0caab6.tar.gz bcm5719-llvm-0aeabdff57adf92c16380048eed8b6c7bf0caab6.zip | |
Fix testsuite regressions from recursive inlining.
llvm-svn: 62189
Diffstat (limited to 'llvm/lib/Transforms/Utils')
| -rw-r--r-- | llvm/lib/Transforms/Utils/InlineFunction.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Utils/InlineFunction.cpp b/llvm/lib/Transforms/Utils/InlineFunction.cpp index 49131e8fd26..0b1105ecdcf 100644 --- a/llvm/lib/Transforms/Utils/InlineFunction.cpp +++ b/llvm/lib/Transforms/Utils/InlineFunction.cpp @@ -150,11 +150,8 @@ static void UpdateCallGraphAfterInlining(CallSite CS, 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); // 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. @@ -171,6 +168,9 @@ static void UpdateCallGraphAfterInlining(CallSite CS, CallerNode->addCalledFunction(CallSite::get(NewCall), I->second); } } + // Update the call graph by deleting the edge from Callee to Caller. We must + // do this after the loop above in case Caller and Callee are the same. + CallerNode->removeCallEdgeFor(CS); } |

