diff options
-rw-r--r-- | include/llvm/CodeGen/LiveInterval.h | 8 | ||||
-rw-r--r-- | lib/CodeGen/LiveInterval.h | 8 |
2 files changed, 14 insertions, 2 deletions
diff --git a/include/llvm/CodeGen/LiveInterval.h b/include/llvm/CodeGen/LiveInterval.h index d25f7e3..7d4c23b 100644 --- a/include/llvm/CodeGen/LiveInterval.h +++ b/include/llvm/CodeGen/LiveInterval.h @@ -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); diff --git a/lib/CodeGen/LiveInterval.h b/lib/CodeGen/LiveInterval.h index d25f7e3..7d4c23b 100644 --- a/lib/CodeGen/LiveInterval.h +++ b/lib/CodeGen/LiveInterval.h @@ -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); |