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 | cb0c9655bfa5bcdbbab54f740a8c07c682fecbdd (patch) | |
tree | 42c6814d96e2e1020603e1690f44741a24953852 /llvm/lib/CodeGen/LiveInterval.h | |
parent | a1f777987643075f6d9dd843f25597f82063ff85 (diff) | |
download | bcm5719-llvm-cb0c9655bfa5bcdbbab54f740a8c07c682fecbdd.tar.gz bcm5719-llvm-cb0c9655bfa5bcdbbab54f740a8c07c682fecbdd.zip |
Add ability to give hints to the overlaps routines.
llvm-svn: 17934
Diffstat (limited to 'llvm/lib/CodeGen/LiveInterval.h')
-rw-r--r-- | llvm/lib/CodeGen/LiveInterval.h | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/LiveInterval.h b/llvm/lib/CodeGen/LiveInterval.h index 05ebcc1ca2f..55de7e38d84 100644 --- a/llvm/lib/CodeGen/LiveInterval.h +++ b/llvm/lib/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 |