diff options
author | Chris Lattner <sabre@nondot.org> | 2002-10-21 15:32:34 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-10-21 15:32:34 +0000 |
commit | c6191df9af70e5432ffc47f752b6911cd81a290d (patch) | |
tree | 6492bdb85401aa3d6b7a29e3c2f5e902eecbcc39 /llvm | |
parent | 78c1e7d83c9bee035a86b0b54508684bbc278dca (diff) | |
download | bcm5719-llvm-c6191df9af70e5432ffc47f752b6911cd81a290d.tar.gz bcm5719-llvm-c6191df9af70e5432ffc47f752b6911cd81a290d.zip |
Add another copy ctor form
llvm-svn: 4251
Diffstat (limited to 'llvm')
-rw-r--r-- | llvm/include/llvm/Analysis/DSGraph.h | 7 | ||||
-rw-r--r-- | llvm/lib/Analysis/DataStructure/DataStructure.cpp | 5 |
2 files changed, 11 insertions, 1 deletions
diff --git a/llvm/include/llvm/Analysis/DSGraph.h b/llvm/include/llvm/Analysis/DSGraph.h index 9324cb7a3c7..2a683655851 100644 --- a/llvm/include/llvm/Analysis/DSGraph.h +++ b/llvm/include/llvm/Analysis/DSGraph.h @@ -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; } diff --git a/llvm/lib/Analysis/DataStructure/DataStructure.cpp b/llvm/lib/Analysis/DataStructure/DataStructure.cpp index cc0b8d8fc5a..4b3be84aaf5 100644 --- a/llvm/lib/Analysis/DataStructure/DataStructure.cpp +++ b/llvm/lib/Analysis/DataStructure/DataStructure.cpp @@ -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(); |