-/// A LiveSegment is a copy of a LiveRange object used within
-/// LiveIntervalUnion. LiveSegment additionally contains a pointer to its
-/// original live virtual register (LiveInterval). This allows quick lookup of
-/// the live virtual register as we iterate over live segments in a union. Note
-/// that LiveRange is misnamed and actually represents only a single contiguous
-/// interval within a virtual register's liveness. To limit confusion, in this
-/// file we refer it as a live segment.
-///
-/// Note: This currently represents a half-open interval [start,end).
-/// If LiveRange is modified to represent a closed interval, so should this.
-struct LiveSegment {
- SlotIndex start;
- SlotIndex end;
- LiveInterval *liveVirtReg;
-
- LiveSegment(SlotIndex s, SlotIndex e, LiveInterval *lvr)
- : start(s), end(e), liveVirtReg(lvr) {}
-
- bool operator==(const LiveSegment &ls) const {
- return start == ls.start && end == ls.end && liveVirtReg == ls.liveVirtReg;
- }
-
- bool operator!=(const LiveSegment &ls) const {
- return !operator==(ls);
- }
-
- // Order segments by starting point only--we expect them to be disjoint.
- bool operator<(const LiveSegment &ls) const { return start < ls.start; }
-
- void dump() const;
- void print(raw_ostream &os) const;
-};
-
-inline bool operator<(SlotIndex V, const LiveSegment &ls) {
- return V < ls.start;
-}
-
-inline bool operator<(const LiveSegment &ls, SlotIndex V) {
- return ls.start < V;
-}
-