Add another copy ctor form

llvm-svn: 4251
This commit is contained in:
Chris Lattner 2002-10-21 15:32:34 +00:00
parent 1276c50e7b
commit 7588e35aa8
2 changed files with 11 additions and 1 deletions

View 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; }

View 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();