summaryrefslogtreecommitdiffstats
path: root/llvm/tools
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-08-31 00:19:58 +0000
committerChris Lattner <sabre@nondot.org>2009-08-31 00:19:58 +0000
commit305b115a8763e0baf7600c023306e62acd02b487 (patch)
tree9908f807acf47fcd2eaa5609d38fd02498c81e0b /llvm/tools
parenta64b1c1d4c77d873cad01c6e4f945e7095ce4934 (diff)
downloadbcm5719-llvm-305b115a8763e0baf7600c023306e62acd02b487.tar.gz
bcm5719-llvm-305b115a8763e0baf7600c023306e62acd02b487.zip
Fix some nasty callgraph dangling pointer problems in
argpromotion and structretpromote. Basically, when replacing a function, they used the 'changeFunction' api which changes the entry in the function map (and steals/reuses the callgraph node). This has some interesting effects: first, the problem is that it doesn't update the "callee" edges in any callees of the function in the call graph. Second, this covers for a major problem in all the CGSCC pass stuff, which is that it is completely broken when functions are deleted if they *don't* reuse a CGN. (there is a cute little fixme about this though :). This patch changes the protocol that CGSCC passes must obey: now the CGSCC pass manager copies the SCC and preincrements its iterator to avoid passes invalidating it. This allows CGSCC passes to mutate the current SCC. However multiple passes may be run on that SCC, so if passes do this, they are now required to *update* the SCC to be current when they return. Other less interesting parts of this patch are that it makes passes update the CG more directly, eliminates changeFunction, and requires clients of replaceCallSite to specify the new callee CGN if they are changing it. llvm-svn: 80527
Diffstat (limited to 'llvm/tools')
-rw-r--r--llvm/tools/opt/opt.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/tools/opt/opt.cpp b/llvm/tools/opt/opt.cpp
index 6effa480001..d8bfd61c232 100644
--- a/llvm/tools/opt/opt.cpp
+++ b/llvm/tools/opt/opt.cpp
@@ -132,7 +132,7 @@ struct CallGraphSCCPassPrinter : public CallGraphSCCPass {
CallGraphSCCPassPrinter(const PassInfo *PI) :
CallGraphSCCPass(&ID), PassToPrint(PI) {}
- virtual bool runOnSCC(const std::vector<CallGraphNode *>&SCC) {
+ virtual bool runOnSCC(std::vector<CallGraphNode *>&SCC) {
if (!Quiet) {
outs() << "Printing analysis '" << PassToPrint->getPassName() << "':\n";
OpenPOWER on IntegriCloud