diff options
author | Chris Lattner <sabre@nondot.org> | 2004-11-18 03:47:34 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-11-18 03:47:34 +0000 |
commit | bae74d9192f04d8185c7b4580565d56cc4ef53f2 (patch) | |
tree | 248a1eff0330784505a938d9ce0dd01e3b6a6f2a /include/llvm/CodeGen | |
parent | cbb5625cecc4f051094fc3afdc5d78fc703cb644 (diff) | |
download | external_llvm-bae74d9192f04d8185c7b4580565d56cc4ef53f2.zip external_llvm-bae74d9192f04d8185c7b4580565d56cc4ef53f2.tar.gz external_llvm-bae74d9192f04d8185c7b4580565d56cc4ef53f2.tar.bz2 |
Add ability to give hints to the overlaps routines.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17934 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen')
-rw-r--r-- | include/llvm/CodeGen/LiveInterval.h | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/include/llvm/CodeGen/LiveInterval.h b/include/llvm/CodeGen/LiveInterval.h index 05ebcc1..55de7e3 100644 --- a/include/llvm/CodeGen/LiveInterval.h +++ b/include/llvm/CodeGen/LiveInterval.h @@ -76,11 +76,14 @@ namespace llvm { : reg(Reg), weight(Weight), NumValues(0) { } - typedef Ranges::iterator iterator; iterator begin() { return ranges.begin(); } iterator end() { return ranges.end(); } + typedef Ranges::const_iterator const_iterator; + const_iterator begin() const { return ranges.begin(); } + const_iterator end() const { return ranges.end(); } + /// advanceTo - Advance the specified iterator to point to the LiveRange /// containing the specified position, or end() if the position is past the @@ -139,7 +142,16 @@ namespace llvm { bool joinable(const LiveInterval& other, unsigned CopyIdx) const; - bool overlaps(const LiveInterval& other) const; + /// overlaps - Return true if the intersection of the two live intervals is + /// not empty. + bool overlaps(const LiveInterval& other) const { + return overlapsFrom(other, other.begin()); + } + + /// overlapsFrom - Return true if the intersection of the two live intervals + /// is not empty. The specified iterator is a hint that we can begin + /// scanning the Other interval starting at I. + bool overlapsFrom(const LiveInterval& other, const_iterator I) const; /// addRange - Add the specified LiveRange to this interval, merging /// intervals as appropriate. This returns an iterator to the inserted live |