diff options
author | Aaron Ballman <aaron@aaronballman.com> | 2014-03-17 15:55:30 +0000 |
---|---|---|
committer | Aaron Ballman <aaron@aaronballman.com> | 2014-03-17 15:55:30 +0000 |
commit | 1683f7baf655ea4c0b0454d8e290c8cc58dfbca4 (patch) | |
tree | 60ecb1fd488126806390af2cc157644f1db4269b /clang/lib/AST/ASTContext.cpp | |
parent | b088fbee3faa396926fc2f676ea9793971ef5801 (diff) | |
download | bcm5719-llvm-1683f7baf655ea4c0b0454d8e290c8cc58dfbca4.tar.gz bcm5719-llvm-1683f7baf655ea4c0b0454d8e290c8cc58dfbca4.zip |
[C++11] Replacing ObjCObjectType iterators qual_begin() and qual_end() with iterator_range quals(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 204047
Diffstat (limited to 'clang/lib/AST/ASTContext.cpp')
-rw-r--r-- | clang/lib/AST/ASTContext.cpp | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index 3af3bff0409..ce12b2f4cb4 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/lib/AST/ASTContext.cpp @@ -6706,16 +6706,9 @@ bool ASTContext::canAssignObjCInterfaces(const ObjCObjectType *LHS, if (SuperClassInheritedProtocols.empty()) return false; - for (ObjCObjectType::qual_iterator LHSPI = LHS->qual_begin(), - LHSPE = LHS->qual_end(); - LHSPI != LHSPE; LHSPI++) { - bool SuperImplementsProtocol = false; - ObjCProtocolDecl *LHSProto = (*LHSPI); - - for (llvm::SmallPtrSet<ObjCProtocolDecl*,8>::iterator I = - SuperClassInheritedProtocols.begin(), - E = SuperClassInheritedProtocols.end(); I != E; ++I) { - ObjCProtocolDecl *SuperClassProto = (*I); + for (const auto *LHSProto : LHS->quals()) { + bool SuperImplementsProtocol = false; + for (auto *SuperClassProto : SuperClassInheritedProtocols) { if (SuperClassProto->lookupProtocolNamed(LHSProto->getIdentifier())) { SuperImplementsProtocol = true; break; @@ -6729,17 +6722,13 @@ bool ASTContext::canAssignObjCInterfaces(const ObjCObjectType *LHS, return false; } - for (ObjCObjectType::qual_iterator LHSPI = LHS->qual_begin(), - LHSPE = LHS->qual_end(); - LHSPI != LHSPE; LHSPI++) { + for (const auto *LHSPI : LHS->quals()) { bool RHSImplementsProtocol = false; // If the RHS doesn't implement the protocol on the left, the types // are incompatible. - for (ObjCObjectType::qual_iterator RHSPI = RHS->qual_begin(), - RHSPE = RHS->qual_end(); - RHSPI != RHSPE; RHSPI++) { - if ((*RHSPI)->lookupProtocolNamed((*LHSPI)->getIdentifier())) { + for (auto *RHSPI : RHS->quals()) { + if (RHSPI->lookupProtocolNamed(LHSPI->getIdentifier())) { RHSImplementsProtocol = true; break; } |