diff options
author | Chris Lattner <sabre@nondot.org> | 2004-07-23 18:39:12 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-07-23 18:39:12 +0000 |
commit | e6ad392802d8643ec7efad9bb80c0c429edda499 (patch) | |
tree | 44489af41a55b2618efc4a2a5279c610a5af3bfd /include | |
parent | 4dc54ae0d950764443ee6a475cc9212d37074747 (diff) | |
download | external_llvm-e6ad392802d8643ec7efad9bb80c0c429edda499.zip external_llvm-e6ad392802d8643ec7efad9bb80c0c429edda499.tar.gz external_llvm-e6ad392802d8643ec7efad9bb80c0c429edda499.tar.bz2 |
New helper method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15138 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/CodeGen/LiveInterval.h | 8 |
1 files changed, 7 insertions, 1 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); |