From 445a939db82713007c9b532144a405f05a587c52 Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Thu, 13 Mar 2014 16:15:17 +0000 Subject: [C++11] Replacing CXXRecordDecl iterators vbases_begin() and vbases_end() with iterator_range vbases(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203808 --- clang/lib/CodeGen/CGClass.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'clang/lib/CodeGen/CGClass.cpp') diff --git a/clang/lib/CodeGen/CGClass.cpp b/clang/lib/CodeGen/CGClass.cpp index bc38a977af7..0bfc188c1a6 100644 --- a/clang/lib/CodeGen/CGClass.cpp +++ b/clang/lib/CodeGen/CGClass.cpp @@ -1213,11 +1213,9 @@ HasTrivialDestructorBody(ASTContext &Context, if (BaseClassDecl == MostDerivedClassDecl) { // Check virtual bases. - for (CXXRecordDecl::base_class_const_iterator I = - BaseClassDecl->vbases_begin(), E = BaseClassDecl->vbases_end(); - I != E; ++I) { + for (const auto &I : BaseClassDecl->vbases()) { const CXXRecordDecl *VirtualBase = - cast(I->getType()->castAs()->getDecl()); + cast(I.getType()->castAs()->getDecl()); if (!HasTrivialDestructorBody(Context, VirtualBase, MostDerivedClassDecl)) return false; @@ -1460,10 +1458,7 @@ void CodeGenFunction::EnterDtorCleanups(const CXXDestructorDecl *DD, // We push them in the forward order so that they'll be popped in // the reverse order. - for (CXXRecordDecl::base_class_const_iterator I = - ClassDecl->vbases_begin(), E = ClassDecl->vbases_end(); - I != E; ++I) { - const CXXBaseSpecifier &Base = *I; + for (const auto &Base : ClassDecl->vbases()) { CXXRecordDecl *BaseClassDecl = cast(Base.getType()->getAs()->getDecl()); -- cgit v1.2.3