[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
diff --git a/clang/lib/AST/VTableBuilder.cpp b/clang/lib/AST/VTableBuilder.cpp
index 02f6d8c..4bf5ef5 100644
--- a/clang/lib/AST/VTableBuilder.cpp
+++ b/clang/lib/AST/VTableBuilder.cpp
@@ -3221,10 +3221,8 @@
// After visiting any direct base, we've transitively visited all of its
// morally virtual bases.
- for (CXXRecordDecl::base_class_const_iterator II = Base->vbases_begin(),
- EE = Base->vbases_end();
- II != EE; ++II)
- VBasesSeen.insert(II->getType()->getAsCXXRecordDecl());
+ for (const auto &I : Base->vbases())
+ VBasesSeen.insert(I.getType()->getAsCXXRecordDecl());
}
// Sort the paths into buckets, and if any of them are ambiguous, extend all
@@ -3407,10 +3405,8 @@
// New vbases are added to the end of the vbtable.
// Skip the self entry and vbases visited in the non-virtual base, if any.
unsigned VBTableIndex = 1 + VBI->VBTableIndices.size();
- for (CXXRecordDecl::base_class_const_iterator I = RD->vbases_begin(),
- E = RD->vbases_end();
- I != E; ++I) {
- const CXXRecordDecl *CurVBase = I->getType()->getAsCXXRecordDecl();
+ for (const auto &I : RD->vbases()) {
+ const CXXRecordDecl *CurVBase = I.getType()->getAsCXXRecordDecl();
if (!VBI->VBTableIndices.count(CurVBase))
VBI->VBTableIndices[CurVBase] = VBTableIndex++;
}