summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Braun <matze@braunis.de>2014-12-10 01:12:02 +0000
committerMatthias Braun <matze@braunis.de>2014-12-10 01:12:02 +0000
commite01cf6e4c0697ebece1df42288b8718a2d7dae69 (patch)
treea8baaa07ab584acac6791a05437b5288bb5a82db
parent24557e5b671350b4e30c60a22e05dc373e806f52 (diff)
downloadbcm5719-llvm-e01cf6e4c0697ebece1df42288b8718a2d7dae69.tar.gz
bcm5719-llvm-e01cf6e4c0697ebece1df42288b8718a2d7dae69.zip
LiveInterval: Add const version of LiveRange::advanceTo().
llvm-svn: 223875
-rw-r--r--llvm/include/llvm/CodeGen/LiveInterval.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/include/llvm/CodeGen/LiveInterval.h b/llvm/include/llvm/CodeGen/LiveInterval.h
index 6629e604653..9b1b65a7ae2 100644
--- a/llvm/include/llvm/CodeGen/LiveInterval.h
+++ b/llvm/include/llvm/CodeGen/LiveInterval.h
@@ -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.
OpenPOWER on IntegriCloud