Lines Matching refs:MergeTo
117 iterator MergeTo = std::next(I); in extendSegmentEndTo() local
118 for (; MergeTo != segments().end() && NewEnd >= MergeTo->end; ++MergeTo) in extendSegmentEndTo()
119 assert(MergeTo->valno == ValNo && "Cannot merge with differing values!"); in extendSegmentEndTo()
122 S->end = std::max(NewEnd, std::prev(MergeTo)->end); in extendSegmentEndTo()
126 if (MergeTo != segments().end() && MergeTo->start <= I->end && in extendSegmentEndTo()
127 MergeTo->valno == ValNo) { in extendSegmentEndTo()
128 S->end = MergeTo->end; in extendSegmentEndTo()
129 ++MergeTo; in extendSegmentEndTo()
133 segments().erase(std::next(I), MergeTo); in extendSegmentEndTo()
145 iterator MergeTo = I; in extendSegmentStartTo() local
147 if (MergeTo == segments().begin()) { in extendSegmentStartTo()
149 segments().erase(MergeTo, I); in extendSegmentStartTo()
152 assert(MergeTo->valno == ValNo && "Cannot merge with differing values!"); in extendSegmentStartTo()
153 --MergeTo; in extendSegmentStartTo()
154 } while (NewStart <= MergeTo->start); in extendSegmentStartTo()
158 if (MergeTo->end >= NewStart && MergeTo->valno == ValNo) { in extendSegmentStartTo()
159 segmentAt(MergeTo)->end = S->end; in extendSegmentStartTo()
162 ++MergeTo; in extendSegmentStartTo()
163 Segment *MergeToSeg = segmentAt(MergeTo); in extendSegmentStartTo()
168 segments().erase(std::next(MergeTo), std::next(I)); in extendSegmentStartTo()
169 return MergeTo; in extendSegmentStartTo()