summaryrefslogtreecommitdiffstats
path: root/lib/Analysis/IPA/CallGraphSCCPass.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-04-16 23:04:30 +0000
committerChris Lattner <sabre@nondot.org>2010-04-16 23:04:30 +0000
commitbde0bb5f882ae708ca70a42bdd3a9805e63f6fb7 (patch)
tree5136f1fffc94de2b38bd783b2cd0718efa9df36d /lib/Analysis/IPA/CallGraphSCCPass.cpp
parent53c5e42ab9c1a2cce7ad19bb0b4dffe33c9473e6 (diff)
downloadexternal_llvm-bde0bb5f882ae708ca70a42bdd3a9805e63f6fb7.zip
external_llvm-bde0bb5f882ae708ca70a42bdd3a9805e63f6fb7.tar.gz
external_llvm-bde0bb5f882ae708ca70a42bdd3a9805e63f6fb7.tar.bz2
building on the new CallGraphSCC abstraction, teach CallGraphSCCPassManager
to keep the node entries in scc_iterator up to date instead of dangling as the SCC mutates. This is a really terrible problem which was causing -g to affect codegen because it would permute the memory image of the compiler process. Thanks to Dale for expertly hunting it down. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101565 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/IPA/CallGraphSCCPass.cpp')
-rw-r--r--lib/Analysis/IPA/CallGraphSCCPass.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Analysis/IPA/CallGraphSCCPass.cpp b/lib/Analysis/IPA/CallGraphSCCPass.cpp
index f5d24f0..7b73c5d 100644
--- a/lib/Analysis/IPA/CallGraphSCCPass.cpp
+++ b/lib/Analysis/IPA/CallGraphSCCPass.cpp
@@ -417,6 +417,11 @@ void CallGraphSCC::ReplaceNode(CallGraphNode *Old, CallGraphNode *New) {
Nodes[i] = New;
break;
}
+
+ // Update the active scc_iterator so that it doesn't contain dangling
+ // pointers to the old CallGraphNode.
+ scc_iterator<CallGraph*> *CGI = (scc_iterator<CallGraph*>*)Context;
+ CGI->ReplaceNode(Old, New);
}