};
std::ostream& operator<<(std::ostream& os, const LiveRange &LR);
+ inline bool operator<(unsigned V, const LiveRange &LR) {
+ return V < LR.start;
+ }
+
+
/// LiveInterval - This class represents some number of live ranges for a
/// register or value. This class also contains a bit of register allocator
/// state.
// definition of the variable it represents. This is because slot 1 is
// used (def slot) and spans up to slot 3 (store slot).
//
-bool LiveInterval::liveAt(unsigned index) const {
- LiveRange dummy(index, index+1);
- Ranges::const_iterator r = std::upper_bound(ranges.begin(),
- ranges.end(),
- dummy);
+bool LiveInterval::liveAt(unsigned I) const {
+ Ranges::const_iterator r = std::upper_bound(ranges.begin(), ranges.end(), I);
+
if (r == ranges.begin())
return false;
--r;
- return index >= r->start && index < r->end;
+ return I >= r->start && I < r->end;
}
// An example for overlaps():
};
std::ostream& operator<<(std::ostream& os, const LiveRange &LR);
+ inline bool operator<(unsigned V, const LiveRange &LR) {
+ return V < LR.start;
+ }
+
+
/// LiveInterval - This class represents some number of live ranges for a
/// register or value. This class also contains a bit of register allocator
/// state.