]> granicus.if.org Git - clang/commitdiff
add a const version of the lookupFieldDeclForIvar method.
authorChris Lattner <sabre@nondot.org>
Tue, 31 Mar 2009 08:31:13 +0000 (08:31 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 31 Mar 2009 08:31:13 +0000 (08:31 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68094 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/DeclObjC.h
lib/AST/ASTContext.cpp

index 76e4c0211e30f4277c2343d39e3c5eef3193a8b3..9acce0f5411acb64ec1bb302b459cd6877f3a1b6 100644 (file)
@@ -412,6 +412,11 @@ public:
   FieldDecl *lookupFieldDeclForIvar(ASTContext &Context, 
                                     const ObjCIvarDecl *ivar);
 
+  const FieldDecl *lookupFieldDeclForIvar(ASTContext &Ctx, 
+                                          const ObjCIvarDecl *IV) const {
+    return const_cast<ObjCInterfaceDecl*>(this)->lookupFieldDeclForIvar(Ctx,IV);
+  }
+
   bool isForwardDecl() const { return ForwardDecl; }
   void setForwardDecl(bool val) { ForwardDecl = val; }
   
index 18a3a4221aa999f9da82c901e4e008cac5c938d6..2e350c850248406df9608c094f0bf2a5c58dbafe 100644 (file)
@@ -650,9 +650,7 @@ const RecordDecl *ASTContext::addRecordToClass(const ObjCInterfaceDecl *D)
 void ASTContext::setFieldDecl(const ObjCInterfaceDecl *OI,
                               const ObjCIvarDecl *Ivar,
                               const ObjCIvarRefExpr *MRef) {
-  FieldDecl *FD = (const_cast<ObjCInterfaceDecl *>(OI))->
-                    lookupFieldDeclForIvar(*this, Ivar);
-  ASTFieldForIvarRef[MRef] = FD;
+  ASTFieldForIvarRef[MRef] = OI->lookupFieldDeclForIvar(*this, Ivar);
 }
 
 /// getASTObjcInterfaceLayout - Get or compute information about the layout of