[llvm-commits] CVS: llvm/include/llvm/Analysis/DataStructure/DSGraph.h DataStructure.h

Chris Lattner lattner at cs.uiuc.edu
Mon Jan 24 11:55:49 PST 2005



Changes in directory llvm/include/llvm/Analysis/DataStructure:

DSGraph.h updated: 1.83 -> 1.84
DataStructure.h updated: 1.81 -> 1.82
---
Log message:

Add some methods.


---
Diffs of the changes:  (+23 -0)

 DSGraph.h       |   13 +++++++++++++
 DataStructure.h |   10 ++++++++++
 2 files changed, 23 insertions(+)


Index: llvm/include/llvm/Analysis/DataStructure/DSGraph.h
diff -u llvm/include/llvm/Analysis/DataStructure/DSGraph.h:1.83 llvm/include/llvm/Analysis/DataStructure/DSGraph.h:1.84
--- llvm/include/llvm/Analysis/DataStructure/DSGraph.h:1.83	Sat Jan  8 22:18:28 2005
+++ llvm/include/llvm/Analysis/DataStructure/DSGraph.h	Mon Jan 24 13:55:34 2005
@@ -55,6 +55,11 @@
 
   void erase(Value *V) { erase(find(V)); }
 
+  void eraseIfExists(Value *V) {
+    iterator I = find(V);
+    if (I != end()) erase(I);
+  }
+
   /// replaceScalar - When an instruction needs to be modified, this method can
   /// be used to update the scalar map to remove the old and insert the new.
   ///
@@ -65,6 +70,14 @@
     erase(I);
   }
 
+  /// copyScalarIfExists - If Old exists in the scalar map, make New point to
+  /// whatever Old did.
+  void copyScalarIfExists(Value *Old, Value *New) {
+    iterator I = find(Old);
+    if (I != end())
+      ValueMap.insert(std::make_pair(New, I->second));
+  }
+
   DSNodeHandle &operator[](Value *V) {
     std::pair<iterator,bool> IP = 
       ValueMap.insert(std::make_pair(V, DSNodeHandle()));


Index: llvm/include/llvm/Analysis/DataStructure/DataStructure.h
diff -u llvm/include/llvm/Analysis/DataStructure/DataStructure.h:1.81 llvm/include/llvm/Analysis/DataStructure/DataStructure.h:1.82
--- llvm/include/llvm/Analysis/DataStructure/DataStructure.h:1.81	Sat Jan  8 22:18:28 2005
+++ llvm/include/llvm/Analysis/DataStructure/DataStructure.h	Mon Jan 24 13:55:34 2005
@@ -113,6 +113,11 @@
 
   DSGraph &getGlobalsGraph() const { return *GlobalsGraph; }
 
+  /// deleteValue/copyValue - Interfaces to update the DSGraphs in the program.
+  /// These correspond to the interfaces defined in the AliasAnalysis class.
+  void deleteValue(Value *V);
+  void copyValue(Value *From, Value *To);
+
   /// print - Print out the analysis results...
   ///
   void print(std::ostream &O, const Module *M) const;
@@ -175,6 +180,11 @@
 
   DSGraph &getGlobalsGraph() const { return *GlobalsGraph; }
 
+  /// deleteValue/copyValue - Interfaces to update the DSGraphs in the program.
+  /// These correspond to the interfaces defined in the AliasAnalysis class.
+  void deleteValue(Value *V);
+  void copyValue(Value *From, Value *To);
+
   /// print - Print out the analysis results...
   ///
   void print(std::ostream &O, const Module *M) const;






More information about the llvm-commits mailing list