diff options
author | Aaron Ballman <aaron@aaronballman.com> | 2014-03-07 19:56:05 +0000 |
---|---|---|
committer | Aaron Ballman <aaron@aaronballman.com> | 2014-03-07 19:56:05 +0000 |
commit | 629afaefe0cd1a583ccee54918b7b13f48bfe273 (patch) | |
tree | 9a236cdf36b4b96c8aad05ccdb63d8f40f9acd9c /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | d72a5f103da45e5abe10497308fce5aeb992cdc2 (diff) | |
download | llvm-629afaefe0cd1a583ccee54918b7b13f48bfe273.zip llvm-629afaefe0cd1a583ccee54918b7b13f48bfe273.tar.gz llvm-629afaefe0cd1a583ccee54918b7b13f48bfe273.tar.bz2 |
[C++11] Replacing DeclBase iterators decls_begin() and decls_end() with iterator_range decls(). The same is true for the noload versions of these APIs. Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 203278
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 9b3e329..a5cd9e3 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -2832,13 +2832,12 @@ void CodeGenModule::EmitObjCIvarInitializations(ObjCImplementationDecl *D) { /// EmitNamespace - Emit all declarations in a namespace. void CodeGenModule::EmitNamespace(const NamespaceDecl *ND) { - for (RecordDecl::decl_iterator I = ND->decls_begin(), E = ND->decls_end(); - I != E; ++I) { - if (const VarDecl *VD = dyn_cast<VarDecl>(*I)) + for (auto *I : ND->decls()) { + if (const auto *VD = dyn_cast<VarDecl>(I)) if (VD->getTemplateSpecializationKind() != TSK_ExplicitSpecialization && VD->getTemplateSpecializationKind() != TSK_Undeclared) continue; - EmitTopLevelDecl(*I); + EmitTopLevelDecl(I); } } @@ -2850,17 +2849,16 @@ void CodeGenModule::EmitLinkageSpec(const LinkageSpecDecl *LSD) { return; } - for (RecordDecl::decl_iterator I = LSD->decls_begin(), E = LSD->decls_end(); - I != E; ++I) { + for (auto *I : LSD->decls()) { // Meta-data for ObjC class includes references to implemented methods. // Generate class's method definitions first. - if (ObjCImplDecl *OID = dyn_cast<ObjCImplDecl>(*I)) { + if (auto *OID = dyn_cast<ObjCImplDecl>(I)) { for (ObjCContainerDecl::method_iterator M = OID->meth_begin(), MEnd = OID->meth_end(); M != MEnd; ++M) EmitTopLevelDecl(*M); } - EmitTopLevelDecl(*I); + EmitTopLevelDecl(I); } } |