[llvm-commits] CVS: poolalloc/lib/PoolAllocate/EquivClassGraphs.cpp EquivClassGraphs.h
Chris Lattner
lattner at cs.uiuc.edu
Mon Nov 1 11:54:16 PST 2004
Changes in directory poolalloc/lib/PoolAllocate:
EquivClassGraphs.cpp updated: 1.9 -> 1.10
EquivClassGraphs.h updated: 1.7 -> 1.8
---
Log message:
Eliminate the cloneGraph method
---
Diffs of the changes: (+2 -10)
Index: poolalloc/lib/PoolAllocate/EquivClassGraphs.cpp
diff -u poolalloc/lib/PoolAllocate/EquivClassGraphs.cpp:1.9 poolalloc/lib/PoolAllocate/EquivClassGraphs.cpp:1.10
--- poolalloc/lib/PoolAllocate/EquivClassGraphs.cpp:1.9 Sun Oct 31 17:41:26 2004
+++ poolalloc/lib/PoolAllocate/EquivClassGraphs.cpp Mon Nov 1 13:54:06 2004
@@ -194,7 +194,7 @@
// This equiv class has multiple functions: merge their graphs. First,
// clone the CBU graph for the leader and make it the common graph for the
// equivalence graph.
- DSGraph* mergedG = cloneGraph(*LF);
+ DSGraph *mergedG = &getOrCreateGraph(*LF);
// Record the argument nodes for use in merging later below
EquivClassGraphArgsInfo& GraphInfo = getECGraphInfo(mergedG);
@@ -255,13 +255,7 @@
DSGraph *&Graph = FoldedGraphsMap[&F];
if (Graph) return *Graph;
- return *cloneGraph(F);
-}
-
-DSGraph *PA::EquivClassGraphs::cloneGraph(Function &F) {
- DSGraph *&Graph = FoldedGraphsMap[&F];
DSGraph &CBUGraph = CBU->getDSGraph(F);
- assert(Graph == 0 && "Cloning a graph twice?");
// Copy the CBU graph...
Graph = new DSGraph(CBUGraph); // updates the map via reference
@@ -278,7 +272,7 @@
FG = Graph;
}
- return Graph;
+ return *Graph;
}
Index: poolalloc/lib/PoolAllocate/EquivClassGraphs.h
diff -u poolalloc/lib/PoolAllocate/EquivClassGraphs.h:1.7 poolalloc/lib/PoolAllocate/EquivClassGraphs.h:1.8
--- poolalloc/lib/PoolAllocate/EquivClassGraphs.h:1.7 Sun Oct 31 17:41:26 2004
+++ poolalloc/lib/PoolAllocate/EquivClassGraphs.h Mon Nov 1 13:54:06 2004
@@ -151,8 +151,6 @@
DSGraph &getOrCreateGraph(Function &F);
- DSGraph* cloneGraph(Function &F);
-
bool hasFoldedGraph(const Function& F) const {
hash_map<const Function*, DSGraph*>::const_iterator I =
FoldedGraphsMap.find(const_cast<Function*>(&F));
More information about the llvm-commits
mailing list