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 | bde0bb5f882ae708ca70a42bdd3a9805e63f6fb7 (patch) | |
tree | 5136f1fffc94de2b38bd783b2cd0718efa9df36d /include/llvm | |
parent | 53c5e42ab9c1a2cce7ad19bb0b4dffe33c9473e6 (diff) | |
download | external_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 'include/llvm')
-rw-r--r-- | include/llvm/ADT/SCCIterator.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/llvm/ADT/SCCIterator.h b/include/llvm/ADT/SCCIterator.h index 3159406..80eb8c5 100644 --- a/include/llvm/ADT/SCCIterator.h +++ b/include/llvm/ADT/SCCIterator.h @@ -183,6 +183,15 @@ public: return true; return false; } + + /// ReplaceNode - This informs the scc_iterator that the specified Old node + /// has been deleted, and New is to be used in its place. + void ReplaceNode(NodeType *Old, NodeType *New) { + assert(!nodeVisitNumbers.count(New) && "New already in scc_iterator?"); + assert(nodeVisitNumbers.count(Old) && "Old not in scc_iterator?"); + nodeVisitNumbers[New] = nodeVisitNumbers[Old]; + nodeVisitNumbers.erase(Old); + } }; |