fix a number of const qualification bugs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49257 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/clang/AST/DeclObjC.h b/include/clang/AST/DeclObjC.h
index d225093..9930f1c 100644
--- a/include/clang/AST/DeclObjC.h
+++ b/include/clang/AST/DeclObjC.h
@@ -125,7 +125,10 @@
   
   NamedDecl *getMethodContext() const { return MethodContext; }
   
-  ObjCInterfaceDecl *const getClassInterface() const;
+  const ObjCInterfaceDecl *getClassInterface() const;
+  ObjCInterfaceDecl *getClassInterface() {
+    return (ObjCInterfaceDecl*)((ObjCMethodDecl*)this)->getClassInterface();
+  }
   
   Selector getSelector() const { return SelName; }
   unsigned getSynthesizedMethodSize() const;
@@ -161,10 +164,12 @@
   ImplementationControl getImplementationControl() const { 
     return ImplementationControl(DeclImplementation); 
   }
-  Stmt *const getBody() const { return Body; }
+  Stmt *getBody() { return Body; }
+  const Stmt *getBody() const { return Body; }
   void setBody(Stmt *B) { Body = B; }
 
-  ParmVarDecl *const getSelfDecl() const { return SelfDecl; }
+  const ParmVarDecl *getSelfDecl() const { return SelfDecl; }
+  ParmVarDecl *getSelfDecl() { return SelfDecl; }
   void setSelfDecl(ParmVarDecl *PVD) { SelfDecl = PVD; }
   
   // Implement isa/cast/dyncast/etc.
@@ -655,7 +660,8 @@
   static ObjCCategoryDecl *Create(ASTContext &C,
                                   SourceLocation L, IdentifierInfo *Id);
   
-  ObjCInterfaceDecl *getClassInterface() const { return ClassInterface; }
+  ObjCInterfaceDecl *getClassInterface() { return ClassInterface; }
+  const ObjCInterfaceDecl *getClassInterface() const { return ClassInterface; }
   void setClassInterface(ObjCInterfaceDecl *IDecl) { ClassInterface = IDecl; }
   
   void setReferencedProtocolList(ObjCProtocolDecl **List, unsigned NumRPs);
@@ -746,7 +752,8 @@
                                       SourceLocation L, IdentifierInfo *Id,
                                       ObjCInterfaceDecl *classInterface);
         
-  ObjCInterfaceDecl *getClassInterface() const { return ClassInterface; }
+  const ObjCInterfaceDecl *getClassInterface() const { return ClassInterface; }
+  ObjCInterfaceDecl *getClassInterface() { return ClassInterface; }
   
   unsigned getNumInstanceMethods() const { return InstanceMethods.size(); }
   unsigned getNumClassMethods() const { return ClassMethods.size(); }
@@ -844,8 +851,10 @@
   SourceLocation getLocEnd() const { return EndLoc; }
   void setLocEnd(SourceLocation LE) { EndLoc = LE; };
   
-  ObjCInterfaceDecl *getClassInterface() const { return ClassInterface; }
-  ObjCInterfaceDecl *getSuperClass() const { return SuperClass; }
+  const ObjCInterfaceDecl *getClassInterface() const { return ClassInterface; }
+  ObjCInterfaceDecl *getClassInterface() { return ClassInterface; }
+  const ObjCInterfaceDecl *getSuperClass() const { return SuperClass; }
+  ObjCInterfaceDecl *getSuperClass() { return SuperClass; }
   
   void setSuperClass(ObjCInterfaceDecl * superCls) { SuperClass = superCls; }
   
diff --git a/include/clang/AST/Expr.h b/include/clang/AST/Expr.h
index 7d1e792..b88d5bd 100644
--- a/include/clang/AST/Expr.h
+++ b/include/clang/AST/Expr.h
@@ -1458,10 +1458,11 @@
   ObjCIvarDecl *getDecl() { return D; }
   const ObjCIvarDecl *getDecl() const { return D; }
   virtual SourceRange getSourceRange() const { return SourceRange(Loc); }
-  Expr *const getBase() const { return Base; }
+  const Expr *getBase() const { return Base; }
+  Expr *getBase() { return Base; }
   void setBase(Expr * base) { Base = base; }
-  const bool isArrow() const { return IsArrow; }
-  const bool isFreeIvar() const { return IsFreeIvar; }
+  bool isArrow() const { return IsArrow; }
+  bool isFreeIvar() const { return IsFreeIvar; }
   
   SourceLocation getLocation() const { return Loc; }
   
diff --git a/include/clang/AST/Stmt.h b/include/clang/AST/Stmt.h
index 78d2ffe..8a882df 100644
--- a/include/clang/AST/Stmt.h
+++ b/include/clang/AST/Stmt.h
@@ -1041,7 +1041,8 @@
     AtThrowLoc = atThrowLoc;
   }
   
-  Expr *const getThrowExpr() const { return reinterpret_cast<Expr*>(Throw); }
+  const Expr *getThrowExpr() const { return reinterpret_cast<Expr*>(Throw); }
+  Expr *getThrowExpr() { return reinterpret_cast<Expr*>(Throw); }
   
   virtual SourceRange getSourceRange() const {
     if (Throw)
diff --git a/include/clang/Analysis/Support/ExprDeclBitVector.h b/include/clang/Analysis/Support/ExprDeclBitVector.h
index e54baca..5796fb3 100644
--- a/include/clang/Analysis/Support/ExprDeclBitVector.h
+++ b/include/clang/Analysis/Support/ExprDeclBitVector.h
@@ -102,7 +102,7 @@
       return DeclBV[i];
     }
     
-    const bool getBit(unsigned i) const {
+    bool getBit(unsigned i) const {
       return DeclBV[i];
     }
     
diff --git a/lib/AST/DeclObjC.cpp b/lib/AST/DeclObjC.cpp
index a01c304..5671dbe 100644
--- a/lib/AST/DeclObjC.cpp
+++ b/lib/AST/DeclObjC.cpp
@@ -418,7 +418,7 @@
   return length; 
 }
 
-ObjCInterfaceDecl *const ObjCMethodDecl::getClassInterface() const {
+const ObjCInterfaceDecl *ObjCMethodDecl::getClassInterface() const {
   if (ObjCInterfaceDecl *ID = dyn_cast<ObjCInterfaceDecl>(MethodContext))
     return ID;
   if (ObjCCategoryDecl *CD = dyn_cast<ObjCCategoryDecl>(MethodContext))