mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-14 11:32:34 +00:00
When we complete the bottom-up pass, make sure to merge the globals in 'main' into
the globals graph. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11562 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
3c5df2612c
commit
28a631d37e
@ -57,6 +57,23 @@ bool BUDataStructures::run(Module &M) {
|
||||
|
||||
NumCallEdges += ActualCallees.size();
|
||||
|
||||
|
||||
// At the end of the BU phase, clone the BU graph for main into the globals
|
||||
// graph to make sure it has everything.
|
||||
if (MainFunc) {
|
||||
DSGraph &MainGraph = getOrCreateGraph(MainFunc);
|
||||
DSScalarMap &MainSM = MainGraph.getScalarMap();
|
||||
ReachabilityCloner RC(*GlobalsGraph, MainGraph, DSGraph::StripAllocaBit);
|
||||
|
||||
// Clone everything reachable from globals in the "main" graph into the
|
||||
// globals graph.
|
||||
for (DSScalarMap::global_iterator I = MainSM.global_begin(),
|
||||
E = MainSM.global_end(); I != E; ++I)
|
||||
RC.getClonedNH(MainSM[*I]);
|
||||
|
||||
|
||||
}
|
||||
|
||||
// At the end of the bottom-up pass, the globals graph becomes complete.
|
||||
// FIXME: This is not the right way to do this, but it is sorta better than
|
||||
// nothing! In particular, externally visible globals and unresolvable call
|
||||
|
Loading…
Reference in New Issue
Block a user