LiveInterval: Add const version of LiveRange::advanceTo().

llvm-svn: 223875
This commit is contained in:
Matthias Braun 2014-12-10 01:12:02 +00:00
parent 24557e5b67
commit e01cf6e4c0
1 changed files with 8 additions and 0 deletions

View File

@ -217,6 +217,14 @@ namespace llvm {
return I;
}
const_iterator advanceTo(const_iterator I, SlotIndex Pos) const {
assert(I != end());
if (Pos >= endIndex())
return end();
while (I->end <= Pos) ++I;
return I;
}
/// find - Return an iterator pointing to the first segment that ends after
/// Pos, or end(). This is the same as advanceTo(begin(), Pos), but faster
/// when searching large ranges.