[cfe-commits] r69563 - in /cfe/trunk: include/clang/AST/DeclObjC.h lib/AST/DeclObjC.cpp lib/CodeGen/CGObjC.cpp lib/CodeGen/CGObjCGNU.cpp lib/CodeGen/CGObjCMac.cpp

Daniel Dunbar daniel at zuster.org
Sun Apr 19 17:37:56 PDT 2009


Author: ddunbar
Date: Sun Apr 19 19:37:55 2009
New Revision: 69563

URL: http://llvm.org/viewvc/llvm-project?rev=69563&view=rev
Log:
Remove non-const form of lookupFieldDeclForIvar.

Modified:
    cfe/trunk/include/clang/AST/DeclObjC.h
    cfe/trunk/lib/AST/DeclObjC.cpp
    cfe/trunk/lib/CodeGen/CGObjC.cpp
    cfe/trunk/lib/CodeGen/CGObjCGNU.cpp
    cfe/trunk/lib/CodeGen/CGObjCMac.cpp

Modified: cfe/trunk/include/clang/AST/DeclObjC.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/DeclObjC.h?rev=69563&r1=69562&r2=69563&view=diff

==============================================================================
--- cfe/trunk/include/clang/AST/DeclObjC.h (original)
+++ cfe/trunk/include/clang/AST/DeclObjC.h Sun Apr 19 19:37:55 2009
@@ -428,13 +428,9 @@
   void setIVarList(ObjCIvarDecl * const *List, unsigned Num, ASTContext &C) {
     IVars.set(List, Num, C);
   }
-  FieldDecl *lookupFieldDeclForIvar(ASTContext &Context, 
-                                    const ObjCIvarDecl *ivar);
 
   const FieldDecl *lookupFieldDeclForIvar(ASTContext &Ctx, 
-                                          const ObjCIvarDecl *IV) const {
-    return const_cast<ObjCInterfaceDecl*>(this)->lookupFieldDeclForIvar(Ctx,IV);
-  }
+                                          const ObjCIvarDecl *IV) const;
 
   bool isForwardDecl() const { return ForwardDecl; }
   void setForwardDecl(bool val) { ForwardDecl = val; }

Modified: cfe/trunk/lib/AST/DeclObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclObjC.cpp?rev=69563&r1=69562&r2=69563&view=diff

==============================================================================
--- cfe/trunk/lib/AST/DeclObjC.cpp (original)
+++ cfe/trunk/lib/AST/DeclObjC.cpp Sun Apr 19 19:37:55 2009
@@ -375,11 +375,12 @@
   return 0;
 }
 
-/// lookupFieldDeclForIvar - looks up a field decl' in the laid out
+/// lookupFieldDeclForIvar - looks up a field decl in the laid out
 /// storage which matches this 'ivar'.
 ///
-FieldDecl *ObjCInterfaceDecl::lookupFieldDeclForIvar(ASTContext &Context, 
-                                                     const ObjCIvarDecl *IVar) {
+const FieldDecl *
+ObjCInterfaceDecl::lookupFieldDeclForIvar(ASTContext &Context, 
+                                          const ObjCIvarDecl *IVar) const {
   const RecordDecl *RecordForDecl = Context.addRecordToClass(this);
   assert(RecordForDecl && "lookupFieldDeclForIvar no storage for class");
   DeclContext::lookup_const_result Lookup =

Modified: cfe/trunk/lib/CodeGen/CGObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGObjC.cpp?rev=69563&r1=69562&r2=69563&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGObjC.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGObjC.cpp Sun Apr 19 19:37:55 2009
@@ -195,7 +195,7 @@
                                            Types.ConvertType(PD->getType())));
     EmitReturnOfRValue(RV, PD->getType());
   } else {
-    FieldDecl *Field = 
+    const FieldDecl *Field = 
       IMP->getClassInterface()->lookupFieldDeclForIvar(getContext(), Ivar);
     LValue LV = EmitLValueForIvar(TypeOfSelfObject(),
                                   LoadObjCSelf(), Ivar, Field, 0);

Modified: cfe/trunk/lib/CodeGen/CGObjCGNU.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGObjCGNU.cpp?rev=69563&r1=69562&r2=69563&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGObjCGNU.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGObjCGNU.cpp Sun Apr 19 19:37:55 2009
@@ -764,7 +764,8 @@
       Context.getObjCEncodingForType((*iter)->getType(), TypeStr);
       IvarTypes.push_back(CGM.GetAddrOfConstantCString(TypeStr));
       // Get the offset
-      FieldDecl *Field = ClassDecl->lookupFieldDeclForIvar(Context, (*iter));
+      const FieldDecl *Field = 
+        ClassDecl->lookupFieldDeclForIvar(Context, (*iter));
       int offset =
         (int)Layout->getElementOffset(CGM.getTypes().getLLVMFieldNo(Field));
       IvarOffsets.push_back(
@@ -1105,7 +1106,8 @@
                             CGM.getContext().getObjCInterfaceType(Interface));
   const llvm::StructLayout *Layout =
     CGM.getTargetData().getStructLayout(cast<llvm::StructType>(InterfaceLTy));
-  FieldDecl *Field = Interface->lookupFieldDeclForIvar(CGM.getContext(), Ivar);
+  const FieldDecl *Field = 
+    Interface->lookupFieldDeclForIvar(CGM.getContext(), Ivar);
   uint64_t Offset =
     Layout->getElementOffset(CGM.getTypes().getLLVMFieldNo(Field));
   

Modified: cfe/trunk/lib/CodeGen/CGObjCMac.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGObjCMac.cpp?rev=69563&r1=69562&r2=69563&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGObjCMac.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGObjCMac.cpp Sun Apr 19 19:37:55 2009
@@ -2400,7 +2400,8 @@
                                        ObjCInterfaceDecl *Interface,
                                        const ObjCIvarDecl *Ivar) {
   const llvm::StructLayout *Layout = GetInterfaceDeclStructLayout(Interface);
-  FieldDecl *Field = Interface->lookupFieldDeclForIvar(CGM.getContext(), Ivar);
+  const FieldDecl *Field = 
+    Interface->lookupFieldDeclForIvar(CGM.getContext(), Ivar);
   uint64_t Offset = GetIvarBaseOffset(Layout, Field);
   return llvm::ConstantInt::get(
                             CGM.getTypes().ConvertType(CGM.getContext().LongTy),





More information about the cfe-commits mailing list