diff options
| author | Aaron Ballman <aaron@aaronballman.com> | 2014-03-13 15:41:46 +0000 |
|---|---|---|
| committer | Aaron Ballman <aaron@aaronballman.com> | 2014-03-13 15:41:46 +0000 |
| commit | 7191c6b0611c04ea2c872b52f1a16e5d819504f1 (patch) | |
| tree | ea866a53220fb82ff11a2814a447ef83c823aca6 /lib/CodeGen/CGExprConstant.cpp | |
| parent | 706a9da3000478eeeb21ea4ce1c8467bbbfcf784 (diff) | |
| download | clang-7191c6b0611c04ea2c872b52f1a16e5d819504f1.tar.gz clang-7191c6b0611c04ea2c872b52f1a16e5d819504f1.tar.bz2 clang-7191c6b0611c04ea2c872b52f1a16e5d819504f1.tar.xz | |
[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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203803 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExprConstant.cpp')
| -rw-r--r-- | lib/CodeGen/CGExprConstant.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/lib/CodeGen/CGExprConstant.cpp b/lib/CodeGen/CGExprConstant.cpp index 2df5de0644..34aa3018fc 100644 --- a/lib/CodeGen/CGExprConstant.cpp +++ b/lib/CodeGen/CGExprConstant.cpp @@ -1268,15 +1268,14 @@ FillInNullDataMemberPointers(CodeGenModule &CGM, QualType T, const ASTRecordLayout &Layout = CGM.getContext().getASTRecordLayout(RD); // Go through all bases and fill in any null pointer to data members. - for (CXXRecordDecl::base_class_const_iterator I = RD->bases_begin(), - E = RD->bases_end(); I != E; ++I) { - if (I->isVirtual()) { + for (const auto &I : RD->bases()) { + if (I.isVirtual()) { // Ignore virtual bases. continue; } const CXXRecordDecl *BaseDecl = - cast<CXXRecordDecl>(I->getType()->getAs<RecordType>()->getDecl()); + cast<CXXRecordDecl>(I.getType()->getAs<RecordType>()->getDecl()); // Ignore empty bases. if (BaseDecl->isEmpty()) @@ -1288,7 +1287,7 @@ FillInNullDataMemberPointers(CodeGenModule &CGM, QualType T, uint64_t BaseOffset = CGM.getContext().toBits(Layout.getBaseClassOffset(BaseDecl)); - FillInNullDataMemberPointers(CGM, I->getType(), + FillInNullDataMemberPointers(CGM, I.getType(), Elements, StartOffset + BaseOffset); } @@ -1338,16 +1337,15 @@ static llvm::Constant *EmitNullConstant(CodeGenModule &CGM, std::vector<llvm::Constant *> elements(numElements); // Fill in all the bases. - for (CXXRecordDecl::base_class_const_iterator - I = record->bases_begin(), E = record->bases_end(); I != E; ++I) { - if (I->isVirtual()) { + for (const auto &I : record->bases()) { + if (I.isVirtual()) { // Ignore virtual bases; if we're laying out for a complete // object, we'll lay these out later. continue; } const CXXRecordDecl *base = - cast<CXXRecordDecl>(I->getType()->castAs<RecordType>()->getDecl()); + cast<CXXRecordDecl>(I.getType()->castAs<RecordType>()->getDecl()); // Ignore empty bases. if (base->isEmpty()) |
