+ // The DSGraph is merged with the globals graph.
+ G.mergeInGlobalsGraph();
+
+ // The nodes reachable from globals need to be recognized as potential
+ // arguments. This is required because, upon merging in the globals graph,
+ // the nodes pointed to by globals that are not live are not marked
+ // incomplete.
+ hash_set<DSNode*> NodesFromGlobals;
+ for (DSGraph::ScalarMapTy::iterator I = G.getScalarMap().begin(),
+ E = G.getScalarMap().end(); I != E; ++I)
+ if (isa<GlobalValue>(I->first)) { // Found a global
+ DSNodeHandle &GH = I->second;
+ GH.getNode()->markReachableNodes(NodesFromGlobals);
+ }
+