aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/Utils/InlineFunction.cpp
diff options
context:
space:
mode:
authorDale Johannesen <dalej@apple.com>2009-01-13 22:43:37 +0000
committerDale Johannesen <dalej@apple.com>2009-01-13 22:43:37 +0000
commit39fa32403e0b5e163f4f05566d6cde65e6c11095 (patch)
tree0df84e83e249bda0805fbe8945ed2602bc1f9fab /lib/Transforms/Utils/InlineFunction.cpp
parentc48c550e1322aebfbe35c7570891619db43bdb9b (diff)
Fix testsuite regressions from recursive inlining.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62189 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Utils/InlineFunction.cpp')
-rw-r--r--lib/Transforms/Utils/InlineFunction.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Transforms/Utils/InlineFunction.cpp b/lib/Transforms/Utils/InlineFunction.cpp
index 49131e8fd2..0b1105ecdc 100644
--- a/lib/Transforms/Utils/InlineFunction.cpp
+++ b/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);
}