]> granicus.if.org Git - clang/commitdiff
Inline GetFirstIvarInRecord into sole caller.
authorDaniel Dunbar <daniel@zuster.org>
Mon, 20 Apr 2009 07:18:49 +0000 (07:18 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Mon, 20 Apr 2009 07:18:49 +0000 (07:18 +0000)
 - No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69582 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGObjCMac.cpp

index b95e67e7074bbfd5b11a7921175a78b1ebbf59b6..db1f6b16d786e9957d2d0073f0b507434ff341e6 100644 (file)
@@ -459,9 +459,6 @@ protected:
   llvm::Constant *GetIvarLayoutName(IdentifierInfo *Ident,
                                     const ObjCCommonTypesHelper &ObjCTypes);
   
-  const RecordDecl *GetFirstIvarInRecord(const ObjCInterfaceDecl *OID,
-                                         RecordDecl::field_iterator &FIV,
-                                         RecordDecl::field_iterator &PIV);  
   /// EmitPropertyList - Emit the given property list. The return
   /// value has type PropertyListPtrTy.
   llvm::Constant *EmitPropertyList(const std::string &Name,
@@ -3103,29 +3100,6 @@ void CGObjCCommonMac::GetNameForMethod(const ObjCMethodDecl *D,
   NameOut += ']';
 }
 
-/// GetFirstIvarInRecord - This routine returns the record for the 
-/// implementation of the fiven class OID. It also returns field
-/// corresponding to the first ivar in the class in FIV. It also
-/// returns the one before the first ivar. 
-///
-const RecordDecl *CGObjCCommonMac::GetFirstIvarInRecord(
-                                          const ObjCInterfaceDecl *OID,
-                                          RecordDecl::field_iterator &FIV,
-                                          RecordDecl::field_iterator &PIV) {
-  int countSuperClassIvars = countInheritedIvars(OID->getSuperClass(),
-                                                 CGM.getContext());
-  const RecordDecl *RD = CGM.getContext().addRecordToClass(OID);
-  RecordDecl::field_iterator ifield = RD->field_begin(CGM.getContext());
-  RecordDecl::field_iterator pfield = RD->field_end(CGM.getContext());
-  while (countSuperClassIvars-- > 0) {
-    pfield = ifield;
-    ++ifield;
-  }
-  FIV = ifield;
-  PIV = pfield;
-  return RD;
-}
-
 void CGObjCMac::FinishModule() {
   EmitModuleInfo();
 
@@ -4232,8 +4206,15 @@ void CGObjCNonFragileABIMac::GetClassSizeInfo(const ObjCInterfaceDecl *OID,
   // FIXME. Share this with the one in EmitIvarList.
   const llvm::StructLayout *Layout = GetInterfaceDeclStructLayout(OID);
     
-  RecordDecl::field_iterator firstField, lastField;
-  const RecordDecl *RD = GetFirstIvarInRecord(OID, firstField, lastField);
+  int countSuperClassIvars = countInheritedIvars(OID->getSuperClass(),
+                                                 CGM.getContext());
+  const RecordDecl *RD = CGM.getContext().addRecordToClass(OID);
+  RecordDecl::field_iterator firstField = RD->field_begin(CGM.getContext());
+  RecordDecl::field_iterator lastField = RD->field_end(CGM.getContext());
+  while (countSuperClassIvars-- > 0) {
+    lastField = firstField;
+    ++firstField;
+  }
     
   for (RecordDecl::field_iterator e = RD->field_end(CGM.getContext()),
          ifield = firstField; ifield != e; ++ifield)