diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-04-20 07:18:49 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-04-20 07:18:49 +0000 |
commit | be1f26df5d6e30d97edd29417c2d788612e34cbc (patch) | |
tree | 4c782c8d2a63924637a19efa7899af7706fcd931 /clang/lib/CodeGen | |
parent | 75e909f5e0d6ed0ac62a4d11022a03c47b459192 (diff) | |
download | bcm5719-llvm-be1f26df5d6e30d97edd29417c2d788612e34cbc.tar.gz bcm5719-llvm-be1f26df5d6e30d97edd29417c2d788612e34cbc.zip |
Inline GetFirstIvarInRecord into sole caller.
- No functionality change.
llvm-svn: 69582
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r-- | clang/lib/CodeGen/CGObjCMac.cpp | 37 |
1 files changed, 9 insertions, 28 deletions
diff --git a/clang/lib/CodeGen/CGObjCMac.cpp b/clang/lib/CodeGen/CGObjCMac.cpp index b95e67e7074..db1f6b16d78 100644 --- a/clang/lib/CodeGen/CGObjCMac.cpp +++ b/clang/lib/CodeGen/CGObjCMac.cpp @@ -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) |