- // cloneInto - Clone the specified DSGraph into the current graph, returning
- // the Return node of the graph. The translated ScalarMap for the old
- // function is filled into the OldValMap member. If StripAllocas is set to
- // 'StripAllocaBit', Alloca markers are removed from the graph as the graph is
- // being cloned.
- //
- DSNodeHandle cloneInto(const DSGraph &G,
- hash_map<Value*, DSNodeHandle> &OldValMap,
- hash_map<const DSNode*, DSNodeHandle> &OldNodeMap,
- unsigned CloneFlags = 0);
+private:
+ void cloneReachableNodes(const DSNode* Node,
+ unsigned BitsToClear,
+ NodeMapTy& OldNodeMap,
+ NodeMapTy& CompletedNodeMap);
+
+public:
+ void updateFromGlobalGraph();
+
+ void cloneReachableSubgraph(const DSGraph& G,
+ const hash_set<const DSNode*>& RootNodes,
+ NodeMapTy& OldNodeMap,
+ NodeMapTy& CompletedNodeMap,
+ unsigned CloneFlags = 0);
+
+ /// cloneInto - Clone the specified DSGraph into the current graph. The
+ /// translated ScalarMap for the old function is filled into the OldValMap
+ /// member, and the translated ReturnNodes map is returned into ReturnNodes.
+ ///
+ /// The CloneFlags member controls various aspects of the cloning process.
+ ///
+ void cloneInto(const DSGraph &G, ScalarMapTy &OldValMap,
+ ReturnNodesTy &OldReturnNodes, NodeMapTy &OldNodeMap,
+ unsigned CloneFlags = 0);