Add another copy ctor form
authorChris Lattner <sabre@nondot.org>
Mon, 21 Oct 2002 15:32:34 +0000 (15:32 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 21 Oct 2002 15:32:34 +0000 (15:32 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4251 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Analysis/DSGraph.h
include/llvm/Analysis/DataStructure/DSGraph.h
lib/Analysis/DataStructure/DataStructure.cpp

index 9324cb7a3c7e25d7e306606f9c35004253234998..2a6836558518a3481b83456e624c8315a3a46a83 100644 (file)
@@ -473,7 +473,12 @@ class DSGraph {
 public:
   DSGraph() : Func(0) {}           // Create a new, empty, DSGraph.
   DSGraph(Function &F);            // Compute the local DSGraph
-  DSGraph(const DSGraph &DSG);     // Copy ctor
+
+  // Copy ctor - If you want to capture the node mapping between the source and
+  // destination graph, you may optionally do this by specifying a map to record
+  // this into.
+  DSGraph(const DSGraph &DSG);
+  DSGraph(const DSGraph &DSG, std::map<const DSNode*, DSNode*> &BUNodeMapTy);
   ~DSGraph();
 
   bool hasFunction() const { return Func != 0; }
index 9324cb7a3c7e25d7e306606f9c35004253234998..2a6836558518a3481b83456e624c8315a3a46a83 100644 (file)
@@ -473,7 +473,12 @@ class DSGraph {
 public:
   DSGraph() : Func(0) {}           // Create a new, empty, DSGraph.
   DSGraph(Function &F);            // Compute the local DSGraph
-  DSGraph(const DSGraph &DSG);     // Copy ctor
+
+  // Copy ctor - If you want to capture the node mapping between the source and
+  // destination graph, you may optionally do this by specifying a map to record
+  // this into.
+  DSGraph(const DSGraph &DSG);
+  DSGraph(const DSGraph &DSG, std::map<const DSNode*, DSNode*> &BUNodeMapTy);
   ~DSGraph();
 
   bool hasFunction() const { return Func != 0; }
index cc0b8d8fc5a93cf17272a0d5ded59eefbd0afa7a..4b3be84aaf5e070b2705c76b6ae37ce8ebcdb9ca 100644 (file)
@@ -371,6 +371,11 @@ DSGraph::DSGraph(const DSGraph &G) : Func(G.Func) {
   RetNode = cloneInto(G, ValueMap, NodeMap);
 }
 
+DSGraph::DSGraph(const DSGraph &G, std::map<const DSNode*, DSNode*> &NodeMap)
+  : Func(G.Func) {
+  RetNode = cloneInto(G, ValueMap, NodeMap);
+}
+
 DSGraph::~DSGraph() {
   FunctionCalls.clear();
   ValueMap.clear();