[llvm-commits] [llvm] r121200 - /llvm/trunk/include/llvm/ADT/IntervalMap.h

Jakob Stoklund Olesen stoklund at 2pi.dk
Tue Dec 7 15:18:43 PST 2010


Author: stoklund
Date: Tue Dec  7 17:18:43 2010
New Revision: 121200

URL: http://llvm.org/viewvc/llvm-project?rev=121200&view=rev
Log:
Fix begin() and end() on const IntervalMap.

Modified:
    llvm/trunk/include/llvm/ADT/IntervalMap.h

Modified: llvm/trunk/include/llvm/ADT/IntervalMap.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/IntervalMap.h?rev=121200&r1=121199&r2=121200&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/IntervalMap.h (original)
+++ llvm/trunk/include/llvm/ADT/IntervalMap.h Tue Dec  7 17:18:43 2010
@@ -1119,7 +1119,7 @@
   friend class iterator;
 
   const_iterator begin() const {
-    iterator I(*this);
+    const_iterator I(*this);
     I.goToBegin();
     return I;
   }
@@ -1131,7 +1131,7 @@
   }
 
   const_iterator end() const {
-    iterator I(*this);
+    const_iterator I(*this);
     I.goToEnd();
     return I;
   }
@@ -1145,7 +1145,7 @@
   /// 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 @@
   // 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");





More information about the llvm-commits mailing list