llvm-6502/lib/Transforms/IPO
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
..
ArgumentPromotion.cpp Fix some nasty callgraph dangling pointer problems in 2009-08-31 00:19:58 +00:00
CMakeLists.txt
ConstantMerge.cpp Use hasDefinitiveInitializer() instead of testing the same thing 2009-08-19 18:20:44 +00:00
DeadArgumentElimination.cpp remove a few DOUTs here and there. 2009-08-23 06:35:02 +00:00
DeadTypeElimination.cpp
ExtractGV.cpp
FunctionAttrs.cpp Fix some nasty callgraph dangling pointer problems in 2009-08-31 00:19:58 +00:00
GlobalDCE.cpp
GlobalOpt.cpp eliminate the "Value" printing methods that print to a std::ostream. 2009-08-23 04:37:46 +00:00
IndMemRemoval.cpp
InlineAlways.cpp
Inliner.cpp Fix some nasty callgraph dangling pointer problems in 2009-08-31 00:19:58 +00:00
InlineSimple.cpp Use hasDefinitiveInitializer() instead of testing the same thing 2009-08-19 18:20:44 +00:00
Internalize.cpp eliminate uses of cerr() 2009-08-23 07:05:07 +00:00
IPConstantPropagation.cpp
IPO.cpp
LoopExtractor.cpp convert LoopInfo.h and GraphWriter.h to use raw_ostream 2009-08-23 07:19:13 +00:00
LowerSetJmp.cpp
Makefile
MergeFunctions.cpp Rename Instruction::isIdenticalTo to Instruction::isIdenticalToWhenDefined, 2009-08-25 22:11:20 +00:00
PartialInlining.cpp
PartialSpecialization.cpp
PruneEH.cpp Fix some nasty callgraph dangling pointer problems in 2009-08-31 00:19:58 +00:00
RaiseAllocations.cpp
StripDeadPrototypes.cpp
StripSymbols.cpp Reapply 79977. 2009-08-28 23:24:31 +00:00
StructRetPromotion.cpp Fix some nasty callgraph dangling pointer problems in 2009-08-31 00:19:58 +00:00