[llvm-commits] CVS: llvm/lib/Analysis/DataStructure/TopDownClosure.cpp
Chris Lattner
lattner at cs.uiuc.edu
Mon Feb 10 12:18:02 PST 2003
Changes in directory llvm/lib/Analysis/DataStructure:
TopDownClosure.cpp updated: 1.38 -> 1.39
---
Log message:
Rearrange code
---
Diffs of the changes:
Index: llvm/lib/Analysis/DataStructure/TopDownClosure.cpp
diff -u llvm/lib/Analysis/DataStructure/TopDownClosure.cpp:1.38 llvm/lib/Analysis/DataStructure/TopDownClosure.cpp:1.39
--- llvm/lib/Analysis/DataStructure/TopDownClosure.cpp:1.38 Sun Feb 9 12:42:43 2003
+++ llvm/lib/Analysis/DataStructure/TopDownClosure.cpp Mon Feb 10 12:16:36 2003
@@ -103,6 +103,15 @@
// Get the current functions graph...
DSGraph &Graph = getOrCreateDSGraph(F);
+ // Recompute the Incomplete markers and eliminate unreachable nodes.
+ Graph.maskIncompleteMarkers();
+ // FIXME: Need to check if all callers have been found, or rather if a
+ // funcpointer escapes!
+ unsigned Flags = F.hasInternalLinkage() ?
+ DSGraph::IgnoreFormalArgs : DSGraph::MarkFormalArgs;
+ Graph.markIncompleteNodes(Flags | DSGraph::IgnoreGlobals);
+ Graph.removeDeadNodes(DSGraph::RemoveUnreachableGlobals);
+
const std::vector<DSCallSite> &CallSites = Graph.getFunctionCalls();
if (CallSites.empty()) {
DEBUG(std::cerr << " [TD] No callees for: " << F.getName() << "\n");
@@ -153,7 +162,8 @@
hash_map<const DSNode*, DSNodeHandle> OldNodeMap;
CG.cloneInto(Graph, OldValMap, OldNodeMap,
DSGraph::StripModRefBits |
- DSGraph::KeepAllocaBit | DSGraph::DontCloneCallNodes);
+ DSGraph::KeepAllocaBit | DSGraph::DontCloneCallNodes |
+ DSGraph::DontCloneAuxCallNodes);
OldValMap.clear(); // We don't care about the ValMap
// Loop over all of the invocation sites of the callee, resolving
@@ -194,8 +204,9 @@
OldNodeMap.clear();
// Recompute the Incomplete markers and eliminate unreachable nodes.
+ CG.removeTriviallyDeadNodes();
CG.maskIncompleteMarkers();
- CG.markIncompleteNodes(DSGraph::MarkFormalArgs);
+ CG.markIncompleteNodes(DSGraph::MarkFormalArgs |DSGraph::IgnoreGlobals);
CG.removeDeadNodes(DSGraph::RemoveUnreachableGlobals);
}
@@ -212,14 +223,5 @@
calculateGraph(*I->first);
}
}
-
- // Recompute the Incomplete markers and eliminate unreachable nodes.
- Graph.maskIncompleteMarkers();
- // FIXME: Need to check if all callers have been found, or rather if a
- // funcpointer escapes!
- unsigned Flags = F.hasInternalLinkage() ?
- DSGraph::IgnoreFormalArgs : DSGraph::MarkFormalArgs;
- Graph.markIncompleteNodes(Flags | DSGraph::IgnoreGlobals);
- Graph.removeDeadNodes(DSGraph::RemoveUnreachableGlobals);
}
More information about the llvm-commits
mailing list