diff options
Diffstat (limited to 'contrib/llvm/tools/clang/lib/ARCMigrate/TransProperties.cpp')
-rw-r--r-- | contrib/llvm/tools/clang/lib/ARCMigrate/TransProperties.cpp | 31 |
1 files changed, 9 insertions, 22 deletions
diff --git a/contrib/llvm/tools/clang/lib/ARCMigrate/TransProperties.cpp b/contrib/llvm/tools/clang/lib/ARCMigrate/TransProperties.cpp index b6ddc43..ab12884 100644 --- a/contrib/llvm/tools/clang/lib/ARCMigrate/TransProperties.cpp +++ b/contrib/llvm/tools/clang/lib/ARCMigrate/TransProperties.cpp @@ -61,7 +61,8 @@ class PropertiesRewriter { ObjCIvarDecl *IvarD; ObjCPropertyImplDecl *ImplD; - PropData(ObjCPropertyDecl *propD) : PropD(propD), IvarD(0), ImplD(0) { } + PropData(ObjCPropertyDecl *propD) + : PropD(propD), IvarD(nullptr), ImplD(nullptr) {} }; typedef SmallVector<PropData, 2> PropsTy; @@ -74,18 +75,16 @@ public: : MigrateCtx(MigrateCtx), Pass(MigrateCtx.Pass) { } static void collectProperties(ObjCContainerDecl *D, AtPropDeclsTy &AtProps, - AtPropDeclsTy *PrevAtProps = 0) { - for (ObjCInterfaceDecl::prop_iterator - propI = D->prop_begin(), - propE = D->prop_end(); propI != propE; ++propI) { - if (propI->getAtLoc().isInvalid()) + AtPropDeclsTy *PrevAtProps = nullptr) { + for (auto *Prop : D->properties()) { + if (Prop->getAtLoc().isInvalid()) continue; - unsigned RawLoc = propI->getAtLoc().getRawEncoding(); + unsigned RawLoc = Prop->getAtLoc().getRawEncoding(); if (PrevAtProps) if (PrevAtProps->find(RawLoc) != PrevAtProps->end()) continue; PropsTy &props = AtProps[RawLoc]; - props.push_back(*propI); + props.push_back(Prop); } } @@ -141,12 +140,8 @@ public: AtPropDeclsTy AtExtProps; // Look through extensions. - for (ObjCInterfaceDecl::visible_extensions_iterator - ext = iface->visible_extensions_begin(), - extEnd = iface->visible_extensions_end(); - ext != extEnd; ++ext) { - collectProperties(*ext, AtExtProps, &AtProps); - } + for (auto *Ext : iface->visible_extensions()) + collectProperties(Ext, AtExtProps, &AtProps); for (AtPropDeclsTy::iterator I = AtExtProps.begin(), E = AtExtProps.end(); I != E; ++I) { @@ -353,14 +348,6 @@ private: return false; } - bool hasAllIvarsBacked(PropsTy &props) const { - for (PropsTy::iterator I = props.begin(), E = props.end(); I != E; ++I) - if (!isUserDeclared(I->IvarD)) - return false; - - return true; - } - // \brief Returns true if all declarations in the @property have GC __weak. bool hasGCWeak(PropsTy &props, SourceLocation atLoc) const { if (!Pass.isGCMigration()) |