[llvm-commits] CVS: poolalloc/lib/PoolAllocate/PoolAllocate.cpp

Chris Lattner lattner at cs.uiuc.edu
Fri Feb 27 14:02:37 PST 2004


Changes in directory poolalloc/lib/PoolAllocate:

PoolAllocate.cpp updated: 1.60 -> 1.61

---
Log message:

Efficiency improvement/code-cleanup


---
Diffs of the changes:  (+3 -4)

Index: poolalloc/lib/PoolAllocate/PoolAllocate.cpp
diff -u poolalloc/lib/PoolAllocate/PoolAllocate.cpp:1.60 poolalloc/lib/PoolAllocate/PoolAllocate.cpp:1.61
--- poolalloc/lib/PoolAllocate/PoolAllocate.cpp:1.60	Sat Feb 21 17:08:36 2004
+++ poolalloc/lib/PoolAllocate/PoolAllocate.cpp	Fri Feb 27 13:59:53 2004
@@ -109,10 +109,9 @@
 
 static void GetNodesReachableFromGlobals(DSGraph &G,
                                          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
-      I->second.getNode()->markReachableNodes(NodesFromGlobals);
+  for (DSScalarMap::global_iterator I = G.getScalarMap().global_begin(), 
+         E = G.getScalarMap().global_end(); I != E; ++I)
+    G.getNodeForValue(*I).getNode()->markReachableNodes(NodesFromGlobals);
 }
 
 // AddPoolPrototypes - Add prototypes for the pool functions to the specified





More information about the llvm-commits mailing list