diff --git a/include/llvm/Analysis/DSGraph.h b/include/llvm/Analysis/DSGraph.h index 3b1aff2396c..64e0b6bf11b 100644 --- a/include/llvm/Analysis/DSGraph.h +++ b/include/llvm/Analysis/DSGraph.h @@ -27,7 +27,7 @@ struct DSGraph { // Public data-type declarations... typedef hash_map ScalarMapTy; typedef hash_map ReturnNodesTy; - typedef hash_set GlobalSetTy; + typedef hash_set GlobalSetTy; /// NodeMapTy - This data type is used when cloning one graph into another to /// keep track of the correspondence between the nodes in the old and new @@ -270,6 +270,8 @@ public: /// 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. + /// OldNodeMap contains a mapping from the original nodes to the newly cloned + /// nodes. /// /// The CloneFlags member controls various aspects of the cloning process. /// @@ -277,6 +279,23 @@ public: ReturnNodesTy &OldReturnNodes, NodeMapTy &OldNodeMap, unsigned CloneFlags = 0); + /// clonePartiallyInto - Clone the reachable subset of the specified DSGraph + /// into the current graph, for the specified function. + /// + /// This differs from cloneInto in that it only clones nodes reachable from + /// globals, call nodes, the scalars specified in ValBindings, and the return + /// value of the specified function. This method merges the the cloned + /// version of the scalars and return value with the specified DSNodeHandles. + /// + /// On return, OldNodeMap contains a mapping from the original nodes to the + /// newly cloned nodes, for the subset of nodes that were actually cloned. + /// + /// The CloneFlags member controls various aspects of the cloning process. + /// + void clonePartiallyInto(const DSGraph &G, Function &F, const DSNodeHandle &RetVal, + const ScalarMapTy &ValBindings, NodeMapTy &OldNodeMap, + unsigned CloneFlags = 0); + /// mergeInGraph - The method is used for merging graphs together. If the /// argument graph is not *this, it makes a clone of the specified graph, then /// merges the nodes specified in the call site with the formal arguments in diff --git a/include/llvm/Analysis/DataStructure/DSGraph.h b/include/llvm/Analysis/DataStructure/DSGraph.h index 3b1aff2396c..64e0b6bf11b 100644 --- a/include/llvm/Analysis/DataStructure/DSGraph.h +++ b/include/llvm/Analysis/DataStructure/DSGraph.h @@ -27,7 +27,7 @@ struct DSGraph { // Public data-type declarations... typedef hash_map ScalarMapTy; typedef hash_map ReturnNodesTy; - typedef hash_set GlobalSetTy; + typedef hash_set GlobalSetTy; /// NodeMapTy - This data type is used when cloning one graph into another to /// keep track of the correspondence between the nodes in the old and new @@ -270,6 +270,8 @@ public: /// 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. + /// OldNodeMap contains a mapping from the original nodes to the newly cloned + /// nodes. /// /// The CloneFlags member controls various aspects of the cloning process. /// @@ -277,6 +279,23 @@ public: ReturnNodesTy &OldReturnNodes, NodeMapTy &OldNodeMap, unsigned CloneFlags = 0); + /// clonePartiallyInto - Clone the reachable subset of the specified DSGraph + /// into the current graph, for the specified function. + /// + /// This differs from cloneInto in that it only clones nodes reachable from + /// globals, call nodes, the scalars specified in ValBindings, and the return + /// value of the specified function. This method merges the the cloned + /// version of the scalars and return value with the specified DSNodeHandles. + /// + /// On return, OldNodeMap contains a mapping from the original nodes to the + /// newly cloned nodes, for the subset of nodes that were actually cloned. + /// + /// The CloneFlags member controls various aspects of the cloning process. + /// + void clonePartiallyInto(const DSGraph &G, Function &F, const DSNodeHandle &RetVal, + const ScalarMapTy &ValBindings, NodeMapTy &OldNodeMap, + unsigned CloneFlags = 0); + /// mergeInGraph - The method is used for merging graphs together. If the /// argument graph is not *this, it makes a clone of the specified graph, then /// merges the nodes specified in the call site with the formal arguments in