From: Chris Lattner Date: Tue, 31 Mar 2009 08:33:16 +0000 (+0000) Subject: small cleanups. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cd0ee14a3b8ba7293670f760c982063f4615e105;p=clang small cleanups. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68095 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CGObjCMac.cpp b/lib/CodeGen/CGObjCMac.cpp index c15c3bb1e7..8bbd1b4caf 100644 --- a/lib/CodeGen/CGObjCMac.cpp +++ b/lib/CodeGen/CGObjCMac.cpp @@ -456,12 +456,12 @@ protected: /// GetIvarBaseOffset - returns ivars byte offset. uint64_t GetIvarBaseOffset(const llvm::StructLayout *Layout, - FieldDecl *Field); + const FieldDecl *Field); - /// GetFieldBaseOffset - return's field byt offset. + /// GetFieldBaseOffset - return's field byte offset. uint64_t GetFieldBaseOffset(const ObjCInterfaceDecl *OI, const llvm::StructLayout *Layout, - FieldDecl *Field); + const FieldDecl *Field); /// CreateMetadataVar - Create a global variable with internal /// linkage for use by the Objective-C runtime. @@ -1829,7 +1829,7 @@ llvm::Function *CGObjCCommonMac::GenerateMethod(const ObjCMethodDecl *OMD, } uint64_t CGObjCCommonMac::GetIvarBaseOffset(const llvm::StructLayout *Layout, - FieldDecl *Field) { + const FieldDecl *Field) { if (!Field->isBitField()) return Layout->getElementOffset( CGM.getTypes().getLLVMFieldNo(Field)); @@ -1844,12 +1844,10 @@ uint64_t CGObjCCommonMac::GetIvarBaseOffset(const llvm::StructLayout *Layout, /// GetFieldBaseOffset - return's field byt offset. uint64_t CGObjCCommonMac::GetFieldBaseOffset(const ObjCInterfaceDecl *OI, const llvm::StructLayout *Layout, - FieldDecl *Field) { + const FieldDecl *Field) { const ObjCIvarDecl *Ivar = cast(Field); - Field = const_cast(OI)->lookupFieldDeclForIvar( - CGM.getContext(), Ivar); - uint64_t Offset = GetIvarBaseOffset(Layout, Field); - return Offset; + const FieldDecl *FD = OI->lookupFieldDeclForIvar(CGM.getContext(), Ivar); + return GetIvarBaseOffset(Layout, FD); } llvm::GlobalVariable *