From 574705ed7f80c59da543ad26d4a5fcd962b5c27d Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Thu, 13 Mar 2014 15:41:46 +0000 Subject: [C++11] Replacing CXXRecordDecl iterators bases_begin() and bases_end() with iterator_range bases(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203803 --- clang/lib/CodeGen/CGDebugInfo.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'clang/lib/CodeGen/CGDebugInfo.cpp') diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp index 97c947097ac..ebca5f8f108 100644 --- a/clang/lib/CodeGen/CGDebugInfo.cpp +++ b/clang/lib/CodeGen/CGDebugInfo.cpp @@ -1172,15 +1172,14 @@ CollectCXXBases(const CXXRecordDecl *RD, llvm::DIFile Unit, llvm::DIType RecordTy) { const ASTRecordLayout &RL = CGM.getContext().getASTRecordLayout(RD); - for (CXXRecordDecl::base_class_const_iterator BI = RD->bases_begin(), - BE = RD->bases_end(); BI != BE; ++BI) { + for (const auto &BI : RD->bases()) { unsigned BFlags = 0; uint64_t BaseOffset; const CXXRecordDecl *Base = - cast(BI->getType()->getAs()->getDecl()); + cast(BI.getType()->getAs()->getDecl()); - if (BI->isVirtual()) { + if (BI.isVirtual()) { // virtual base offset offset is -ve. The code generator emits dwarf // expression where it expects +ve number. BaseOffset = @@ -1192,7 +1191,7 @@ CollectCXXBases(const CXXRecordDecl *RD, llvm::DIFile Unit, // FIXME: Inconsistent units for BaseOffset. It is in bytes when // BI->isVirtual() and bits when not. - AccessSpecifier Access = BI->getAccessSpecifier(); + AccessSpecifier Access = BI.getAccessSpecifier(); if (Access == clang::AS_private) BFlags |= llvm::DIDescriptor::FlagPrivate; else if (Access == clang::AS_protected) @@ -1200,7 +1199,7 @@ CollectCXXBases(const CXXRecordDecl *RD, llvm::DIFile Unit, llvm::DIType DTy = DBuilder.createInheritance(RecordTy, - getOrCreateType(BI->getType(), Unit), + getOrCreateType(BI.getType(), Unit), BaseOffset, BFlags); EltTys.push_back(DTy); } -- cgit v1.2.3