summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-02-10 18:16:36 +0000
committerChris Lattner <sabre@nondot.org>2003-02-10 18:16:36 +0000
commitb96f2123abbbe26fa6b10335fd735e7488f0bea7 (patch)
tree1a1bd61021791fb2a6b6e0eb30198b417f1ed92c /llvm/lib
parent5153d44a91443cdd627cb84890970d663503ccae (diff)
downloadbcm5719-llvm-b96f2123abbbe26fa6b10335fd735e7488f0bea7.tar.gz
bcm5719-llvm-b96f2123abbbe26fa6b10335fd735e7488f0bea7.zip
Rearrange code
llvm-svn: 5527
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Analysis/DataStructure/TopDownClosure.cpp24
1 files changed, 13 insertions, 11 deletions
diff --git a/llvm/lib/Analysis/DataStructure/TopDownClosure.cpp b/llvm/lib/Analysis/DataStructure/TopDownClosure.cpp
index 269a9a41994..de6233d4c8e 100644
--- a/llvm/lib/Analysis/DataStructure/TopDownClosure.cpp
+++ b/llvm/lib/Analysis/DataStructure/TopDownClosure.cpp
@@ -103,6 +103,15 @@ void TDDataStructures::calculateGraph(Function &F) {
// 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 @@ void TDDataStructures::calculateGraph(Function &F) {
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 @@ void TDDataStructures::calculateGraph(Function &F) {
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 @@ void TDDataStructures::calculateGraph(Function &F) {
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);
}
OpenPOWER on IntegriCloud