summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2010-12-07 23:18:43 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2010-12-07 23:18:43 +0000
commite702cde2dd99de3605c95c8fc4786212cfdc7ce8 (patch)
treeed62d5a6a53af87578eafd26e67ebb011e3d0bd8 /llvm
parentaa92f631b45fc15ba85eef80b89c903b96f4529b (diff)
downloadbcm5719-llvm-e702cde2dd99de3605c95c8fc4786212cfdc7ce8.tar.gz
bcm5719-llvm-e702cde2dd99de3605c95c8fc4786212cfdc7ce8.zip
Fix begin() and end() on const IntervalMap.
llvm-svn: 121200
Diffstat (limited to 'llvm')
-rw-r--r--llvm/include/llvm/ADT/IntervalMap.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/llvm/include/llvm/ADT/IntervalMap.h b/llvm/include/llvm/ADT/IntervalMap.h
index 33569269c68..deba71d6ebf 100644
--- a/llvm/include/llvm/ADT/IntervalMap.h
+++ b/llvm/include/llvm/ADT/IntervalMap.h
@@ -1119,7 +1119,7 @@ public:
friend class iterator;
const_iterator begin() const {
- iterator I(*this);
+ const_iterator I(*this);
I.goToBegin();
return I;
}
@@ -1131,7 +1131,7 @@ public:
}
const_iterator end() const {
- iterator I(*this);
+ const_iterator I(*this);
I.goToEnd();
return I;
}
@@ -1145,7 +1145,7 @@ public:
/// find - Return an iterator pointing to the first interval ending at or
/// after x, or end().
const_iterator find(KeyT x) const {
- iterator I(*this);
+ const_iterator I(*this);
I.find(x);
return I;
}
@@ -1347,7 +1347,8 @@ protected:
// The path may be partially filled, but never between iterator calls.
IntervalMapImpl::Path path;
- explicit const_iterator(IntervalMap &map) : map(&map) {}
+ explicit const_iterator(const IntervalMap &map) :
+ map(const_cast<IntervalMap*>(&map)) {}
bool branched() const {
assert(map && "Invalid iterator");
OpenPOWER on IntegriCloud