diff options
Diffstat (limited to 'clang/lib/Rewrite')
-rw-r--r-- | clang/lib/Rewrite/Frontend/RewriteModernObjC.cpp | 16 | ||||
-rw-r--r-- | clang/lib/Rewrite/Frontend/RewriteObjC.cpp | 16 |
2 files changed, 8 insertions, 24 deletions
diff --git a/clang/lib/Rewrite/Frontend/RewriteModernObjC.cpp b/clang/lib/Rewrite/Frontend/RewriteModernObjC.cpp index 369383e0dad..93e89a91ad6 100644 --- a/clang/lib/Rewrite/Frontend/RewriteModernObjC.cpp +++ b/clang/lib/Rewrite/Frontend/RewriteModernObjC.cpp @@ -1404,12 +1404,8 @@ void RewriteModernObjC::RewriteImplementationDecl(Decl *OID) { const char *endBuf = SM->getCharacterData(LocEnd); ReplaceText(LocStart, endBuf-startBuf, ResultStr); } - for (ObjCCategoryImplDecl::propimpl_iterator - I = IMD ? IMD->propimpl_begin() : CID->propimpl_begin(), - E = IMD ? IMD->propimpl_end() : CID->propimpl_end(); - I != E; ++I) { - RewritePropertyImplDecl(*I, IMD, CID); - } + for (auto *I : IMD ? IMD->property_impls() : CID->property_impls()) + RewritePropertyImplDecl(I, IMD, CID); InsertText(IMD ? IMD->getLocEnd() : CID->getLocEnd(), "// "); } @@ -7220,9 +7216,7 @@ void RewriteModernObjC::RewriteObjCClassMetaData(ObjCImplementationDecl *IDecl, // If any of our property implementations have associated getters or // setters, produce metadata for them as well. - for (ObjCImplDecl::propimpl_iterator Prop = IDecl->propimpl_begin(), - PropEnd = IDecl->propimpl_end(); - Prop != PropEnd; ++Prop) { + for (const auto *Prop : IDecl->property_impls()) { if (Prop->getPropertyImplementation() == ObjCPropertyImplDecl::Dynamic) continue; if (!Prop->getPropertyIvarDecl()) @@ -7475,9 +7469,7 @@ void RewriteModernObjC::RewriteObjCCategoryImplDecl(ObjCCategoryImplDecl *IDecl, // If any of our property implementations have associated getters or // setters, produce metadata for them as well. - for (ObjCImplDecl::propimpl_iterator Prop = IDecl->propimpl_begin(), - PropEnd = IDecl->propimpl_end(); - Prop != PropEnd; ++Prop) { + for (const auto *Prop : IDecl->property_impls()) { if (Prop->getPropertyImplementation() == ObjCPropertyImplDecl::Dynamic) continue; if (!Prop->getPropertyIvarDecl()) diff --git a/clang/lib/Rewrite/Frontend/RewriteObjC.cpp b/clang/lib/Rewrite/Frontend/RewriteObjC.cpp index 6fe2f1b897f..735d1021fe3 100644 --- a/clang/lib/Rewrite/Frontend/RewriteObjC.cpp +++ b/clang/lib/Rewrite/Frontend/RewriteObjC.cpp @@ -1197,12 +1197,8 @@ void RewriteObjC::RewriteImplementationDecl(Decl *OID) { const char *endBuf = SM->getCharacterData(LocEnd); ReplaceText(LocStart, endBuf-startBuf, ResultStr); } - for (ObjCCategoryImplDecl::propimpl_iterator - I = IMD ? IMD->propimpl_begin() : CID->propimpl_begin(), - E = IMD ? IMD->propimpl_end() : CID->propimpl_end(); - I != E; ++I) { - RewritePropertyImplDecl(*I, IMD, CID); - } + for (auto *I : IMD ? IMD->property_impls() : CID->property_impls()) + RewritePropertyImplDecl(I, IMD, CID); InsertText(IMD ? IMD->getLocEnd() : CID->getLocEnd(), "// "); } @@ -5429,9 +5425,7 @@ void RewriteObjCFragileABI::RewriteObjCClassMetaData(ObjCImplementationDecl *IDe // If any of our property implementations have associated getters or // setters, produce metadata for them as well. - for (ObjCImplDecl::propimpl_iterator Prop = IDecl->propimpl_begin(), - PropEnd = IDecl->propimpl_end(); - Prop != PropEnd; ++Prop) { + for (const auto *Prop : IDecl->property_impls()) { if (Prop->getPropertyImplementation() == ObjCPropertyImplDecl::Dynamic) continue; if (!Prop->getPropertyIvarDecl()) @@ -5710,9 +5704,7 @@ void RewriteObjCFragileABI::RewriteObjCCategoryImplDecl(ObjCCategoryImplDecl *ID // If any of our property implementations have associated getters or // setters, produce metadata for them as well. - for (ObjCImplDecl::propimpl_iterator Prop = IDecl->propimpl_begin(), - PropEnd = IDecl->propimpl_end(); - Prop != PropEnd; ++Prop) { + for (const auto *Prop : IDecl->property_impls()) { if (Prop->getPropertyImplementation() == ObjCPropertyImplDecl::Dynamic) continue; if (!Prop->getPropertyIvarDecl()) |