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 | e8a8baef44c4df704170c74f6117b8541b1ec752 (patch) | |
tree | 4267c871876046245818e1d246fa452cea91004a /clang/lib/CodeGen/CGCall.cpp | |
parent | 1b91204e3dafe5eb8eafa50ad1d51494ee0ef854 (diff) | |
download | bcm5719-llvm-e8a8baef44c4df704170c74f6117b8541b1ec752.tar.gz bcm5719-llvm-e8a8baef44c4df704170c74f6117b8541b1ec752.zip |
[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.
llvm-svn: 203355
Diffstat (limited to 'clang/lib/CodeGen/CGCall.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGCall.cpp | 28 |
1 files changed, 8 insertions, 20 deletions
diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp index 133a692f4ce..4f564df208a 100644 --- a/clang/lib/CodeGen/CGCall.cpp +++ b/clang/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); } |