diff options
author | David Blaikie <dblaikie@gmail.com> | 2012-04-30 02:36:29 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2012-04-30 02:36:29 +0000 |
commit | 262bc18e32500558af7cb0afa205b34bd37bafed (patch) | |
tree | 6948b171ad9895169475e9f5808700781231a710 /lib/CodeGen/CGObjCMac.cpp | |
parent | 298038352b34c5503db418201f3ddea6e56fd0e1 (diff) |
Remove the ref/value inconsistency in filter_decl_iterator.
filter_decl_iterator had a weird mismatch where both op* and op-> returned T*
making it difficult to generalize this filtering behavior into a reusable
library of any kind.
This change errs on the side of value, making op-> return T* and op* return
T&.
(reviewed by Richard Smith)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155808 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGObjCMac.cpp')
-rw-r--r-- | lib/CodeGen/CGObjCMac.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/CodeGen/CGObjCMac.cpp b/lib/CodeGen/CGObjCMac.cpp index 7796f92aff..42c91cb8e2 100644 --- a/lib/CodeGen/CGObjCMac.cpp +++ b/lib/CodeGen/CGObjCMac.cpp @@ -2121,7 +2121,7 @@ PushProtocolProperties(llvm::SmallPtrSet<const IdentifierInfo*,16> &PropertySet, PushProtocolProperties(PropertySet, Properties, Container, (*P), ObjCTypes); for (ObjCContainerDecl::prop_iterator I = PROTO->prop_begin(), E = PROTO->prop_end(); I != E; ++I) { - const ObjCPropertyDecl *PD = *I; + const ObjCPropertyDecl *PD = &*I; if (!PropertySet.insert(PD->getIdentifier())) continue; llvm::Constant *Prop[] = { @@ -2152,7 +2152,7 @@ llvm::Constant *CGObjCCommonMac::EmitPropertyList(Twine Name, llvm::SmallPtrSet<const IdentifierInfo*, 16> PropertySet; for (ObjCContainerDecl::prop_iterator I = OCD->prop_begin(), E = OCD->prop_end(); I != E; ++I) { - const ObjCPropertyDecl *PD = *I; + const ObjCPropertyDecl *PD = &*I; PropertySet.insert(PD->getIdentifier()); llvm::Constant *Prop[] = { GetPropertyName(PD->getIdentifier()), @@ -2403,7 +2403,7 @@ void CGObjCMac::GenerateClass(const ObjCImplementationDecl *ID) { for (ObjCImplementationDecl::propimpl_iterator i = ID->propimpl_begin(), e = ID->propimpl_end(); i != e; ++i) { - ObjCPropertyImplDecl *PID = *i; + ObjCPropertyImplDecl *PID = &*i; if (PID->getPropertyImplementation() == ObjCPropertyImplDecl::Synthesize) { ObjCPropertyDecl *PD = PID->getPropertyDecl(); @@ -3818,7 +3818,10 @@ void CGObjCCommonMac::BuildAggrIvarRecordLayout(const RecordType *RT, bool &HasUnion) { const RecordDecl *RD = RT->getDecl(); // FIXME - Use iterator. - SmallVector<const FieldDecl*, 16> Fields(RD->field_begin(), RD->field_end()); + SmallVector<const FieldDecl*, 16> Fields; + for (RecordDecl::field_iterator i = RD->field_begin(), + e = RD->field_end(); i != e; ++i) + Fields.push_back(&*i); llvm::Type *Ty = CGM.getTypes().ConvertType(QualType(RT, 0)); const llvm::StructLayout *RecLayout = CGM.getTargetData().getStructLayout(cast<llvm::StructType>(Ty)); @@ -5001,7 +5004,7 @@ llvm::GlobalVariable * CGObjCNonFragileABIMac::BuildClassRoTInitializer( } for (ObjCImplementationDecl::propimpl_iterator i = ID->propimpl_begin(), e = ID->propimpl_end(); i != e; ++i) { - ObjCPropertyImplDecl *PID = *i; + ObjCPropertyImplDecl *PID = &*i; if (PID->getPropertyImplementation() == ObjCPropertyImplDecl::Synthesize){ ObjCPropertyDecl *PD = PID->getPropertyDecl(); |