[cfe-commits] r101999 - in /cfe/trunk/include/clang/AST: ExprObjC.h Stmt.h

Benjamin Kramer benny.kra at googlemail.com
Wed Apr 21 05:21:20 PDT 2010


Author: d0k
Date: Wed Apr 21 07:21:20 2010
New Revision: 101999

URL: http://llvm.org/viewvc/llvm-project?rev=101999&view=rev
Log:
Add more const to ConstExprIterator.

Modified:
    cfe/trunk/include/clang/AST/ExprObjC.h
    cfe/trunk/include/clang/AST/Stmt.h

Modified: cfe/trunk/include/clang/AST/ExprObjC.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/ExprObjC.h?rev=101999&r1=101998&r2=101999&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/ExprObjC.h (original)
+++ cfe/trunk/include/clang/AST/ExprObjC.h Wed Apr 21 07:21:20 2010
@@ -706,12 +706,8 @@
 
   arg_iterator arg_begin() { return getArgs(); }
   arg_iterator arg_end()   { return getArgs() + NumArgs; }
-  const_arg_iterator arg_begin() const {
-    return const_cast<Stmt**>(getArgs());
-  }
-  const_arg_iterator arg_end() const {
-    return const_cast<Stmt**>(getArgs()) + NumArgs;
-  }
+  const_arg_iterator arg_begin() const { return getArgs(); }
+  const_arg_iterator arg_end() const { return getArgs() + NumArgs; }
 };
 
 /// ObjCSuperExpr - Represents the "super" expression in Objective-C,

Modified: cfe/trunk/include/clang/AST/Stmt.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Stmt.h?rev=101999&r1=101998&r2=101999&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/Stmt.h (original)
+++ cfe/trunk/include/clang/AST/Stmt.h Wed Apr 21 07:21:20 2010
@@ -70,13 +70,13 @@
   };
 
   class ConstExprIterator {
-    Stmt* const * I;
+    const Stmt * const *I;
   public:
-    ConstExprIterator(Stmt* const* i) : I(i) {}
+    ConstExprIterator(const Stmt * const *i) : I(i) {}
     ConstExprIterator() : I(0) {}
     ConstExprIterator& operator++() { ++I; return *this; }
-    ConstExprIterator operator+(size_t i) { return I+i; }
-    ConstExprIterator operator-(size_t i) { return I-i; }
+    ConstExprIterator operator+(size_t i) const { return I+i; }
+    ConstExprIterator operator-(size_t i) const { return I-i; }
     const Expr * operator[](size_t idx) const;
     signed operator-(const ConstExprIterator& R) const { return I - R.I; }
     const Expr * operator*() const;





More information about the cfe-commits mailing list