[llvm-commits] CVS: llvm/include/llvm/CodeGen/LiveRangeInfo.h

Vikram Adve vadve at cs.uiuc.edu
Tue Jul 29 14:39:01 PDT 2003


Changes in directory llvm/include/llvm/CodeGen:

LiveRangeInfo.h updated: 1.17 -> 1.18

---
Log message:

Add const version of getLiveRangeForValue().


---
Diffs of the changes:

Index: llvm/include/llvm/CodeGen/LiveRangeInfo.h
diff -u llvm/include/llvm/CodeGen/LiveRangeInfo.h:1.17 llvm/include/llvm/CodeGen/LiveRangeInfo.h:1.18
--- llvm/include/llvm/CodeGen/LiveRangeInfo.h:1.17	Sat Jul 26 17:59:45 2003
+++ llvm/include/llvm/CodeGen/LiveRangeInfo.h	Tue Jul 29 14:38:22 2003
@@ -92,10 +92,15 @@
   inline const LiveRangeMapType *getLiveRangeMap() const 
     { return &LiveRangeMap; }
 
-  // Method sed to get the corresponding live range of a Value
-  //
-  inline LiveRange *getLiveRangeForValue( const Value *Val) 
-    { return LiveRangeMap[Val]; }
+  // Method used to get the live range containing a Value.
+  // This may return NULL if no live range exists for a Value (eg, some consts)
+  inline LiveRange *getLiveRangeForValue(const Value *Val) {
+    return LiveRangeMap[Val];
+  }
+  inline const LiveRange *getLiveRangeForValue(const Value *Val) const {
+    LiveRangeMapType::const_iterator I = LiveRangeMap.find(Val);
+    return I->second;
+  }
 
   // Method for coalescing live ranges. Called only after interference info
   // is calculated.





More information about the llvm-commits mailing list