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 | caabaa8e4b0d6d4534152852a3dfc69cfd386050 (patch) | |
tree | 8d66826ff8200fa980f9e1af2a894513470cac91 /lib/CodeGen/CGDebugInfo.cpp | |
parent | 445fc769a36f34b7b173566fb5016506199f843d (diff) | |
download | clang-caabaa8e4b0d6d4534152852a3dfc69cfd386050.tar.gz clang-caabaa8e4b0d6d4534152852a3dfc69cfd386050.tar.bz2 clang-caabaa8e4b0d6d4534152852a3dfc69cfd386050.tar.xz |
[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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203278 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r-- | lib/CodeGen/CGDebugInfo.cpp | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp index 761876988a..d115f264ba 100644 --- a/lib/CodeGen/CGDebugInfo.cpp +++ b/lib/CodeGen/CGDebugInfo.cpp @@ -935,9 +935,8 @@ void CGDebugInfo::CollectRecordFields(const RecordDecl *record, // Static and non-static members should appear in the same order as // the corresponding declarations in the source program. - for (RecordDecl::decl_iterator I = record->decls_begin(), - E = record->decls_end(); I != E; ++I) - if (const VarDecl *V = dyn_cast<VarDecl>(*I)) { + for (const auto *I : record->decls()) + if (const auto *V = dyn_cast<VarDecl>(I)) { // Reuse the existing static member declaration if one exists llvm::DenseMap<const Decl *, llvm::WeakVH>::iterator MI = StaticDataMemberCache.find(V->getCanonicalDecl()); @@ -948,7 +947,7 @@ void CGDebugInfo::CollectRecordFields(const RecordDecl *record, llvm::DIDerivedType(cast<llvm::MDNode>(MI->second))); } else elements.push_back(CreateRecordStaticField(V, RecordTy)); - } else if (FieldDecl *field = dyn_cast<FieldDecl>(*I)) { + } else if (const auto *field = dyn_cast<FieldDecl>(I)) { CollectRecordNormalField(field, layout.getFieldOffset(fieldNo), tunit, elements, RecordTy); @@ -1130,9 +1129,8 @@ CollectCXXMemberFunctions(const CXXRecordDecl *RD, llvm::DIFile Unit, // Since we want more than just the individual member decls if we // have templated functions iterate over every declaration to gather // the functions. - for(DeclContext::decl_iterator I = RD->decls_begin(), - E = RD->decls_end(); I != E; ++I) { - if (const CXXMethodDecl *Method = dyn_cast<CXXMethodDecl>(*I)) { + for(const auto *I : RD->decls()) { + if (const auto *Method = dyn_cast<CXXMethodDecl>(I)) { // Reuse the existing member function declaration if it exists. // It may be associated with the declaration of the type & should be // reused as we're building the definition. @@ -1149,8 +1147,7 @@ CollectCXXMemberFunctions(const CXXRecordDecl *RD, llvm::DIFile Unit, EltTys.push_back(CreateCXXMemberFunction(Method, Unit, RecordTy)); } else EltTys.push_back(MI->second); - } else if (const FunctionTemplateDecl *FTD = - dyn_cast<FunctionTemplateDecl>(*I)) { + } else if (const auto *FTD = dyn_cast<FunctionTemplateDecl>(I)) { // Add any template specializations that have already been seen. Like // implicit member functions, these may have been added to a declaration // in the case of vtable-based debug info reduction. |