diff options
| author | Aaron Ballman <aaron@aaronballman.com> | 2014-03-08 20:12:42 +0000 |
|---|---|---|
| committer | Aaron Ballman <aaron@aaronballman.com> | 2014-03-08 20:12:42 +0000 |
| commit | 8328f6462b3e0b8d77a2da5cfbdf1885950e5fc8 (patch) | |
| tree | 4f04e9f1980f32d611aa295339a054b06e255cd4 /lib/CodeGen/CGCall.cpp | |
| parent | 0ce08a07392951d4c05c8d754317cfd3105760d0 (diff) | |
| download | clang-8328f6462b3e0b8d77a2da5cfbdf1885950e5fc8.tar.gz clang-8328f6462b3e0b8d77a2da5cfbdf1885950e5fc8.tar.bz2 clang-8328f6462b3e0b8d77a2da5cfbdf1885950e5fc8.tar.xz | |
[C++11] Replacing RecordDecl iterators field_begin() and field_end() with iterator_range fields(). Updating all of the usages of the iterators with range-based for loops.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203355 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGCall.cpp')
| -rw-r--r-- | lib/CodeGen/CGCall.cpp | 28 |
1 files changed, 8 insertions, 20 deletions
diff --git a/lib/CodeGen/CGCall.cpp b/lib/CodeGen/CGCall.cpp index 133a692f4c..4f564df208 100644 --- a/lib/CodeGen/CGCall.cpp +++ b/lib/CodeGen/CGCall.cpp @@ -552,9 +552,7 @@ void CodeGenTypes::GetExpandedTypes(QualType type, const FieldDecl *LargestFD = 0; CharUnits UnionSize = CharUnits::Zero(); - for (RecordDecl::field_iterator i = RD->field_begin(), e = RD->field_end(); - i != e; ++i) { - const FieldDecl *FD = *i; + for (const auto *FD : RD->fields()) { assert(!FD->isBitField() && "Cannot expand structure with bit-field members."); CharUnits FieldSize = getContext().getTypeSizeInChars(FD->getType()); @@ -566,11 +564,10 @@ void CodeGenTypes::GetExpandedTypes(QualType type, if (LargestFD) GetExpandedTypes(LargestFD->getType(), expandedTypes); } else { - for (RecordDecl::field_iterator i = RD->field_begin(), e = RD->field_end(); - i != e; ++i) { - assert(!i->isBitField() && + for (const auto *I : RD->fields()) { + assert(!I->isBitField() && "Cannot expand structure with bit-field members."); - GetExpandedTypes(i->getType(), expandedTypes); + GetExpandedTypes(I->getType(), expandedTypes); } } } else if (const ComplexType *CT = type->getAs<ComplexType>()) { @@ -603,9 +600,7 @@ CodeGenFunction::ExpandTypeFromArgs(QualType Ty, LValue LV, const FieldDecl *LargestFD = 0; CharUnits UnionSize = CharUnits::Zero(); - for (RecordDecl::field_iterator i = RD->field_begin(), e = RD->field_end(); - i != e; ++i) { - const FieldDecl *FD = *i; + for (const auto *FD : RD->fields()) { assert(!FD->isBitField() && "Cannot expand structure with bit-field members."); CharUnits FieldSize = getContext().getTypeSizeInChars(FD->getType()); @@ -620,9 +615,7 @@ CodeGenFunction::ExpandTypeFromArgs(QualType Ty, LValue LV, AI = ExpandTypeFromArgs(LargestFD->getType(), SubLV, AI); } } else { - for (RecordDecl::field_iterator i = RD->field_begin(), e = RD->field_end(); - i != e; ++i) { - FieldDecl *FD = *i; + for (const auto *FD : RD->fields()) { QualType FT = FD->getType(); // FIXME: What are the right qualifiers here? @@ -2475,9 +2468,7 @@ void CodeGenFunction::ExpandTypeToArgs(QualType Ty, RValue RV, const FieldDecl *LargestFD = 0; CharUnits UnionSize = CharUnits::Zero(); - for (RecordDecl::field_iterator i = RD->field_begin(), e = RD->field_end(); - i != e; ++i) { - const FieldDecl *FD = *i; + for (const auto *FD : RD->fields()) { assert(!FD->isBitField() && "Cannot expand structure with bit-field members."); CharUnits FieldSize = getContext().getTypeSizeInChars(FD->getType()); @@ -2491,10 +2482,7 @@ void CodeGenFunction::ExpandTypeToArgs(QualType Ty, RValue RV, ExpandTypeToArgs(LargestFD->getType(), FldRV, Args, IRFuncTy); } } else { - for (RecordDecl::field_iterator i = RD->field_begin(), e = RD->field_end(); - i != e; ++i) { - FieldDecl *FD = *i; - + for (const auto *FD : RD->fields()) { RValue FldRV = EmitRValueForField(LV, FD, SourceLocation()); ExpandTypeToArgs(FD->getType(), FldRV, Args, IRFuncTy); } |
