llvm-6502/lib
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
..
Analysis Fix some nasty callgraph dangling pointer problems in 2009-08-31 00:19:58 +00:00
Archive Prune #includes from llvm/Linker.h and llvm/System/Path.h, 2009-08-23 22:45:37 +00:00
AsmParser Minor logic simplification. 2009-08-29 23:37:49 +00:00
Bitcode Reapply 79977. 2009-08-28 23:24:31 +00:00
CodeGen Nuke moribund "std::string" version of EOL(..., Encoding). 2009-08-30 00:28:57 +00:00
CompilerDriver convert LoopInfo.h and GraphWriter.h to use raw_ostream 2009-08-23 07:19:13 +00:00
Debugger Prune #includes from llvm/Linker.h and llvm/System/Path.h, 2009-08-23 22:45:37 +00:00
ExecutionEngine Fix OProfile support after r80406 changed the DebugInfo interface from 2009-08-29 00:44:16 +00:00
Linker Prune #includes from llvm/Linker.h and llvm/System/Path.h, 2009-08-23 22:45:37 +00:00
MC llvm-mc: MCStreamer cleanups. - Remove EmitLocalSymbol, this is unsupported for now. 2009-08-30 06:17:16 +00:00
Support Fix some possible-use-of-uninitialized warnings. 2009-08-30 21:13:58 +00:00
System remove the last uses of Config/alloca.h 2009-08-23 22:57:38 +00:00
Target Add missed pattern 2009-08-30 19:06:39 +00:00
Transforms Fix some nasty callgraph dangling pointer problems in 2009-08-31 00:19:58 +00:00
VMCore Cleanup whitespace and indentation. 2009-08-29 23:35:16 +00:00
Makefile