llvm-6502/lib/Analysis/IPA
Chris Lattner be577659d3 Step #1 to giving Callgraph some sane invariants. The problems with callgraph
stem from the fact that we have two types of passes that need to update it:

1. callgraphscc and module passes that are explicitly aware of it
2. Functionpasses (and loop passes etc) that are interlaced with CGSCC passes
   by the CGSCC Passmgr.

In the case of #1, we can reasonably expect the passes to update the call
graph just like any analysis.  However, functionpasses are not and generally
should not be CG aware.  This has caused us no end of problems, so this takes
a new approach.  Logically, the CGSCC Pass manager can rescan every function 
after it runs a function pass over it to see if the functionpass made any 
updates to the IR that affect the callgraph.  This allows it to catch new calls
introduced by the functionpass.

In practice, doing this would be slow.  This implementation keeps track of
whether or not the current scc is dirtied by a function pass, and, if so, 
delays updating the callgraph until it is actually needed again.  This was
we avoid extraneous rescans, but we still have good invariants when the
callgraph is needed.

Step #2 of the "give Callgraph some sane invariants" is to change CallGraphNode
to use a CallBackVH for the callsite entry of the CallGraphNode.  This way
we can immediately remove entries from the callgraph when a FunctionPass is
active instead of having dangling pointers.  The current pass tries to tolerate
these dangling pointers, but it is just an evil hack.

This is related to PR3601/4835/4029.  This also reverts r80541, a hack working
around the sad lack of invariants.





git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80566 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 07:23:46 +00:00
..
Andersens.cpp Mark Andersen's as experimental. 2009-08-28 00:45:47 +00:00
CallGraph.cpp Step #1 to giving Callgraph some sane invariants. The problems with callgraph 2009-08-31 07:23:46 +00:00
CallGraphSCCPass.cpp Step #1 to giving Callgraph some sane invariants. The problems with callgraph 2009-08-31 07:23:46 +00:00
CMakeLists.txt Initial support for the CMake build system. 2008-09-22 01:08:49 +00:00
FindUsedTypes.cpp Change Pass::print to take a raw ostream instead of std::ostream, 2009-08-23 06:03:38 +00:00
GlobalsModRef.cpp Revert r66920. It was causing failures in the self-hosting buildbot (in release 2009-03-13 21:15:59 +00:00
Makefile Removed trailing whitespace from Makefiles. 2009-01-09 16:44:42 +00:00