diff options
| author | Chris Lattner <sabre@nondot.org> | 2010-04-16 23:04:30 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2010-04-16 23:04:30 +0000 |
| commit | de023a3c1d1946db496055695e7d1fde421c409f (patch) | |
| tree | 6aeb2ded9ce36c53343ebfd433a502fe0b78bb2c /llvm/lib | |
| parent | 9becdddc49d794317b55ac505d76f5f68de26441 (diff) | |
| download | bcm5719-llvm-de023a3c1d1946db496055695e7d1fde421c409f.tar.gz bcm5719-llvm-de023a3c1d1946db496055695e7d1fde421c409f.zip | |
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.
llvm-svn: 101565
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp b/llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp index f5d24f005f5..7b73c5dffce 100644 --- a/llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp +++ b/llvm/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); } |

