Remove const qualifier (all Value*'s are nonconst in DSA, so it's not clear
authorChris Lattner <sabre@nondot.org>
Thu, 22 Jan 2004 15:26:52 +0000 (15:26 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 22 Jan 2004 15:26:52 +0000 (15:26 +0000)
why this one was)

Add new method proto

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10950 91177308-0d34-0410-b5e6-96231b3b80d8

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

index 3b1aff2396cf33650939082f5ef67c043407827d..64e0b6bf11bccedeb40838337dab7ce3fce3cfe6 100644 (file)
@@ -27,7 +27,7 @@ struct DSGraph {
   // Public data-type declarations...
   typedef hash_map<Value*, DSNodeHandle> ScalarMapTy;
   typedef hash_map<Function*, DSNodeHandle> ReturnNodesTy;
-  typedef hash_set<const GlobalValue*> GlobalSetTy;
+  typedef hash_set<GlobalValue*> 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
index 3b1aff2396cf33650939082f5ef67c043407827d..64e0b6bf11bccedeb40838337dab7ce3fce3cfe6 100644 (file)
@@ -27,7 +27,7 @@ struct DSGraph {
   // Public data-type declarations...
   typedef hash_map<Value*, DSNodeHandle> ScalarMapTy;
   typedef hash_map<Function*, DSNodeHandle> ReturnNodesTy;
-  typedef hash_set<const GlobalValue*> GlobalSetTy;
+  typedef hash_set<GlobalValue*> 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