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

Chris Lattner lattner at cs.uiuc.edu
Thu Feb 19 15:30:02 PST 2004


Changes in directory llvm/include/llvm/Analysis:

DSGraph.h updated: 1.74 -> 1.75

---
Log message:

Add a method useful for updating DSA


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

Index: llvm/include/llvm/Analysis/DSGraph.h
diff -u llvm/include/llvm/Analysis/DSGraph.h:1.74 llvm/include/llvm/Analysis/DSGraph.h:1.75
--- llvm/include/llvm/Analysis/DSGraph.h:1.74	Sat Feb  7 19:27:13 2004
+++ llvm/include/llvm/Analysis/DSGraph.h	Thu Feb 19 15:27:50 2004
@@ -54,6 +54,15 @@
 
   void erase(Value *V) { erase(find(V)); }
 
+  /// 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.
+  void replaceScalar(Value *Old, Value *New) {
+    iterator I = find(Old);
+    assert(I != end() && "Old value is not in the map!");
+    ValueMap.insert(std::make_pair(New, I->second));
+    erase(I);
+  }
+
   DSNodeHandle &operator[](Value *V) {
     std::pair<iterator,bool> IP = 
       ValueMap.insert(std::make_pair(V, DSNodeHandle()));





More information about the llvm-commits mailing list