[llvm-commits] CVS: llvm/lib/CodeGen/LiveInterval.h

Chris Lattner lattner at cs.uiuc.edu
Fri Jul 23 11:40:23 PDT 2004



Changes in directory llvm/lib/CodeGen:

LiveInterval.h updated: 1.2 -> 1.3

---
Log message:

New helper method


---
Diffs of the changes:  (+7 -1)

Index: llvm/lib/CodeGen/LiveInterval.h
diff -u llvm/lib/CodeGen/LiveInterval.h:1.2 llvm/lib/CodeGen/LiveInterval.h:1.3
--- llvm/lib/CodeGen/LiveInterval.h:1.2	Fri Jul 23 13:13:24 2004
+++ llvm/lib/CodeGen/LiveInterval.h	Fri Jul 23 13:39:12 2004
@@ -36,13 +36,19 @@
       assert(S < E && "Cannot create empty or backwards range");
     }
 
+    /// contains - Return true if the index is covered by this range.
+    ///
+    bool contains(unsigned I) const {
+      return start <= I && I < end;
+    }
+
     bool operator<(const LiveRange &LR) const {
       return start < LR.start || (start == LR.start && end < LR.end);
     }
     bool operator==(const LiveRange &LR) const {
       return start == LR.start && end == LR.end;
     }
-    private:
+  private:
     LiveRange(); // DO NOT IMPLEMENT
   };
   std::ostream& operator<<(std::ostream& os, const LiveRange &LR);





More information about the llvm-commits mailing list