New helper method
[oota-llvm.git] / include / llvm / CodeGen / LiveInterval.h
index d25f7e31a340135f71fd21ecfbb53c3b65e6cc56..7d4c23b2c85077c13c315b8d854654d1b79673bd 100644 (file)
@@ -36,13 +36,19 @@ namespace llvm {
       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);