diff options
author | Chris Lattner <sabre@nondot.org> | 2004-01-28 03:07:30 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-01-28 03:07:30 +0000 |
commit | 34741cf0ddf947132781a42a1613ba20c1d8b9c1 (patch) | |
tree | 0679d1072c672cfe780756e6743d9c352aabb0da /lib/Analysis/DataStructure/TopDownClosure.cpp | |
parent | bdce7b78442b719256e914a983fcb58873f7d5b5 (diff) |
In the TD pass, don't iterate over the scalar map to find the globals, iterate over
the globals directly. This doesn't save any substantial time, however, because the
globals graph only contains globals!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10997 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/DataStructure/TopDownClosure.cpp')
-rw-r--r-- | lib/Analysis/DataStructure/TopDownClosure.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/Analysis/DataStructure/TopDownClosure.cpp b/lib/Analysis/DataStructure/TopDownClosure.cpp index 01dec2978d..67ea400dce 100644 --- a/lib/Analysis/DataStructure/TopDownClosure.cpp +++ b/lib/Analysis/DataStructure/TopDownClosure.cpp @@ -62,10 +62,9 @@ bool TDDataStructures::run(Module &M) { // globals graph. const DSGraph::ScalarMapTy &GGSM = GlobalsGraph->getScalarMap(); hash_set<DSNode*> Visited; - for (DSGraph::ScalarMapTy::const_iterator I = GGSM.begin(), E = GGSM.end(); + for (DSScalarMap::global_iterator I = GGSM.global_begin(), E = GGSM.global_end(); I != E; ++I) - if (isa<GlobalValue>(I->first)) - markReachableFunctionsExternallyAccessible(I->second.getNode(), Visited); + markReachableFunctionsExternallyAccessible(GGSM.find(*I)->second.getNode(), Visited); // Loop over unresolved call nodes. Any functions passed into (but not // returned!) from unresolvable call nodes may be invoked outside of the |