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 | 2d7c57ec1dca2ca678d086b545c4cf38091d0902 (patch) | |
tree | 3568bffdf992022c819331a278aec3ae60696215 /clang/lib/Rewrite/RewriteObjC.cpp | |
parent | 13ef0cfd6976f54c5922be4ee2aaa4dac4395959 (diff) | |
download | bcm5719-llvm-2d7c57ec1dca2ca678d086b545c4cf38091d0902.tar.gz bcm5719-llvm-2d7c57ec1dca2ca678d086b545c4cf38091d0902.zip |
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)
llvm-svn: 155808
Diffstat (limited to 'clang/lib/Rewrite/RewriteObjC.cpp')
-rw-r--r-- | clang/lib/Rewrite/RewriteObjC.cpp | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/clang/lib/Rewrite/RewriteObjC.cpp b/clang/lib/Rewrite/RewriteObjC.cpp index 9c0737f659a..485cffc38f2 100644 --- a/clang/lib/Rewrite/RewriteObjC.cpp +++ b/clang/lib/Rewrite/RewriteObjC.cpp @@ -967,7 +967,7 @@ void RewriteObjC::RewriteCategoryDecl(ObjCCategoryDecl *CatDecl) { for (ObjCCategoryDecl::prop_iterator I = CatDecl->prop_begin(), E = CatDecl->prop_end(); I != E; ++I) - RewriteProperty(*I); + RewriteProperty(&*I); for (ObjCCategoryDecl::instmeth_iterator I = CatDecl->instmeth_begin(), E = CatDecl->instmeth_end(); @@ -1001,7 +1001,7 @@ void RewriteObjC::RewriteProtocolDecl(ObjCProtocolDecl *PDecl) { for (ObjCInterfaceDecl::prop_iterator I = PDecl->prop_begin(), E = PDecl->prop_end(); I != E; ++I) - RewriteProperty(*I); + RewriteProperty(&*I); // Lastly, comment out the @end. SourceLocation LocEnd = PDecl->getAtEndRange().getBegin(); @@ -1207,7 +1207,7 @@ void RewriteObjC::RewriteImplementationDecl(Decl *OID) { I = IMD ? IMD->propimpl_begin() : CID->propimpl_begin(), E = IMD ? IMD->propimpl_end() : CID->propimpl_end(); I != E; ++I) { - RewritePropertyImplDecl(*I, IMD, CID); + RewritePropertyImplDecl(&*I, IMD, CID); } InsertText(IMD ? IMD->getLocEnd() : CID->getLocEnd(), "// "); @@ -1233,7 +1233,7 @@ void RewriteObjC::RewriteInterfaceDecl(ObjCInterfaceDecl *ClassDecl) { for (ObjCInterfaceDecl::prop_iterator I = ClassDecl->prop_begin(), E = ClassDecl->prop_end(); I != E; ++I) - RewriteProperty(*I); + RewriteProperty(&*I); for (ObjCInterfaceDecl::instmeth_iterator I = ClassDecl->instmeth_begin(), E = ClassDecl->instmeth_end(); I != E; ++I) @@ -4881,7 +4881,7 @@ Stmt *RewriteObjC::RewriteFunctionBodyOrGlobalInitializer(Stmt *S) { void RewriteObjC::RewriteRecordBody(RecordDecl *RD) { for (RecordDecl::field_iterator i = RD->field_begin(), e = RD->field_end(); i != e; ++i) { - FieldDecl *FD = *i; + FieldDecl *FD = &*i; if (isTopLevelBlockPointerType(FD->getType())) RewriteBlockPointerDecl(FD); if (FD->getType()->isObjCQualifiedIdType() || @@ -5434,7 +5434,7 @@ void RewriteObjCFragileABI::RewriteObjCClassMetaData(ObjCImplementationDecl *IDe for (ObjCInterfaceDecl::ivar_iterator IV = IDecl->ivar_begin(), IVEnd = IDecl->ivar_end(); IV != IVEnd; ++IV) - IVars.push_back(*IV); + IVars.push_back(&*IV); IVI = IDecl->ivar_begin(); IVE = IDecl->ivar_end(); } else { @@ -5442,25 +5442,25 @@ void RewriteObjCFragileABI::RewriteObjCClassMetaData(ObjCImplementationDecl *IDe IVE = CDecl->ivar_end(); } Result += "\t,{{\""; - Result += (*IVI)->getNameAsString(); + Result += IVI->getNameAsString(); Result += "\", \""; std::string TmpString, StrEncoding; - Context->getObjCEncodingForType((*IVI)->getType(), TmpString, *IVI); + Context->getObjCEncodingForType(IVI->getType(), TmpString, &*IVI); QuoteDoublequotes(TmpString, StrEncoding); Result += StrEncoding; Result += "\", "; - RewriteIvarOffsetComputation(*IVI, Result); + RewriteIvarOffsetComputation(&*IVI, Result); Result += "}\n"; for (++IVI; IVI != IVE; ++IVI) { Result += "\t ,{\""; - Result += (*IVI)->getNameAsString(); + Result += IVI->getNameAsString(); Result += "\", \""; std::string TmpString, StrEncoding; - Context->getObjCEncodingForType((*IVI)->getType(), TmpString, *IVI); + Context->getObjCEncodingForType(IVI->getType(), TmpString, &*IVI); QuoteDoublequotes(TmpString, StrEncoding); Result += StrEncoding; Result += "\", "; - RewriteIvarOffsetComputation((*IVI), Result); + RewriteIvarOffsetComputation(&*IVI, Result); Result += "}\n"; } @@ -5476,11 +5476,11 @@ void RewriteObjCFragileABI::RewriteObjCClassMetaData(ObjCImplementationDecl *IDe for (ObjCImplDecl::propimpl_iterator Prop = IDecl->propimpl_begin(), PropEnd = IDecl->propimpl_end(); Prop != PropEnd; ++Prop) { - if ((*Prop)->getPropertyImplementation() == ObjCPropertyImplDecl::Dynamic) + if (Prop->getPropertyImplementation() == ObjCPropertyImplDecl::Dynamic) continue; - if (!(*Prop)->getPropertyIvarDecl()) + if (!Prop->getPropertyIvarDecl()) continue; - ObjCPropertyDecl *PD = (*Prop)->getPropertyDecl(); + ObjCPropertyDecl *PD = Prop->getPropertyDecl(); if (!PD) continue; if (ObjCMethodDecl *Getter = PD->getGetterMethodDecl()) @@ -5761,11 +5761,11 @@ void RewriteObjCFragileABI::RewriteObjCCategoryImplDecl(ObjCCategoryImplDecl *ID for (ObjCImplDecl::propimpl_iterator Prop = IDecl->propimpl_begin(), PropEnd = IDecl->propimpl_end(); Prop != PropEnd; ++Prop) { - if ((*Prop)->getPropertyImplementation() == ObjCPropertyImplDecl::Dynamic) + if (Prop->getPropertyImplementation() == ObjCPropertyImplDecl::Dynamic) continue; - if (!(*Prop)->getPropertyIvarDecl()) + if (!Prop->getPropertyIvarDecl()) continue; - ObjCPropertyDecl *PD = (*Prop)->getPropertyDecl(); + ObjCPropertyDecl *PD = Prop->getPropertyDecl(); if (!PD) continue; if (ObjCMethodDecl *Getter = PD->getGetterMethodDecl()) |