llvm-6502/tools/opt
Chris Lattner 5095e3d1d1 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80527 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 00:19:58 +00:00
..
AnalysisWrappers.cpp Change Pass::print to take a raw ostream instead of std::ostream, 2009-08-23 06:03:38 +00:00
CMakeLists.txt Initial support for the CMake build system. 2008-09-22 01:08:49 +00:00
GraphPrinters.cpp Make LLVM command-line tools overwrite their output files without -f. 2009-08-25 15:34:52 +00:00
Makefile Fixed file header comment. 2009-04-01 21:37:19 +00:00
opt.cpp Fix some nasty callgraph dangling pointer problems in 2009-08-31 00:19:58 +00:00
PrintSCC.cpp Change Pass::print to take a raw ostream instead of std::ostream, 2009-08-23 06:03:38 +00:00