aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-11-01 19:54:06 +0000
committerChris Lattner <sabre@nondot.org>2004-11-01 19:54:06 +0000
commit68f9658fcb8941a67ee33696428b4a28585e6cd5 (patch)
tree77cfa4a00f9a04eccb9eff7a34ab2275af522b03
parent936e5ca38b1d6557d2cafd6d8021c23548b8c784 (diff)
downloadexternal_llvm-68f9658fcb8941a67ee33696428b4a28585e6cd5.zip
external_llvm-68f9658fcb8941a67ee33696428b4a28585e6cd5.tar.gz
external_llvm-68f9658fcb8941a67ee33696428b4a28585e6cd5.tar.bz2
Eliminate the cloneGraph method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17405 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/Analysis/DataStructure/EquivClassGraphs.h2
-rw-r--r--lib/Analysis/DataStructure/EquivClassGraphs.cpp10
2 files changed, 2 insertions, 10 deletions
diff --git a/include/llvm/Analysis/DataStructure/EquivClassGraphs.h b/include/llvm/Analysis/DataStructure/EquivClassGraphs.h
index 8a4b9e2..320513f 100644
--- a/include/llvm/Analysis/DataStructure/EquivClassGraphs.h
+++ b/include/llvm/Analysis/DataStructure/EquivClassGraphs.h
@@ -151,8 +151,6 @@ namespace PA {
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));
diff --git a/lib/Analysis/DataStructure/EquivClassGraphs.cpp b/lib/Analysis/DataStructure/EquivClassGraphs.cpp
index e21b4d9..0e20714 100644
--- a/lib/Analysis/DataStructure/EquivClassGraphs.cpp
+++ b/lib/Analysis/DataStructure/EquivClassGraphs.cpp
@@ -194,7 +194,7 @@ void PA::EquivClassGraphs::buildIndirectFunctionSets(Module &M) {
// 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 &PA::EquivClassGraphs::getOrCreateGraph(Function &F) {
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 @@ DSGraph *PA::EquivClassGraphs::cloneGraph(Function &F) {
FG = Graph;
}
- return Graph;
+ return *Graph;
}