llvm.org GIT mirror llvm / bde0bb5
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 Chris Lattner 10 years ago
2 changed file(s) with 14 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
182182 return true;
183183 return false;
184184 }
185
186 /// ReplaceNode - This informs the scc_iterator that the specified Old node
187 /// has been deleted, and New is to be used in its place.
188 void ReplaceNode(NodeType *Old, NodeType *New) {
189 assert(!nodeVisitNumbers.count(New) && "New already in scc_iterator?");
190 assert(nodeVisitNumbers.count(Old) && "Old not in scc_iterator?");
191 nodeVisitNumbers[New] = nodeVisitNumbers[Old];
192 nodeVisitNumbers.erase(Old);
193 }
185194 };
186195
187196
416416 Nodes[i] = New;
417417 break;
418418 }
419
420 // Update the active scc_iterator so that it doesn't contain dangling
421 // pointers to the old CallGraphNode.
422 scc_iterator *CGI = (scc_iterator*)Context;
423 CGI->ReplaceNode(Old, New);
419424 }
420425
421426