diff options
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r-- | clang/lib/CodeGen/CGObjCGNU.cpp | 5 | ||||
-rw-r--r-- | clang/lib/CodeGen/CGObjCMac.cpp | 5 |
2 files changed, 4 insertions, 6 deletions
diff --git a/clang/lib/CodeGen/CGObjCGNU.cpp b/clang/lib/CodeGen/CGObjCGNU.cpp index 9a5ccfa646c..7a5344bd298 100644 --- a/clang/lib/CodeGen/CGObjCGNU.cpp +++ b/clang/lib/CodeGen/CGObjCGNU.cpp @@ -1755,9 +1755,8 @@ void CGObjCGNU::GenerateProtocol(const ObjCProtocolDecl *PD) { PD = Def; SmallVector<std::string, 16> Protocols; - for (ObjCProtocolDecl::protocol_iterator PI = PD->protocol_begin(), - E = PD->protocol_end(); PI != E; ++PI) - Protocols.push_back((*PI)->getNameAsString()); + for (const auto *PI : PD->protocols()) + Protocols.push_back(PI->getNameAsString()); SmallVector<llvm::Constant*, 16> InstanceMethodNames; SmallVector<llvm::Constant*, 16> InstanceMethodTypes; SmallVector<llvm::Constant*, 16> OptionalInstanceMethodNames; diff --git a/clang/lib/CodeGen/CGObjCMac.cpp b/clang/lib/CodeGen/CGObjCMac.cpp index e62eddd695a..8777549749d 100644 --- a/clang/lib/CodeGen/CGObjCMac.cpp +++ b/clang/lib/CodeGen/CGObjCMac.cpp @@ -2771,9 +2771,8 @@ PushProtocolProperties(llvm::SmallPtrSet<const IdentifierInfo*,16> &PropertySet, const Decl *Container, const ObjCProtocolDecl *Proto, const ObjCCommonTypesHelper &ObjCTypes) { - for (ObjCProtocolDecl::protocol_iterator P = Proto->protocol_begin(), - E = Proto->protocol_end(); P != E; ++P) - PushProtocolProperties(PropertySet, Properties, Container, (*P), ObjCTypes); + for (const auto *P : Proto->protocols()) + PushProtocolProperties(PropertySet, Properties, Container, P, ObjCTypes); for (const auto *PD : Proto->properties()) { if (!PropertySet.insert(PD->getIdentifier())) continue; |