summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/TargetInfo.cpp
diff options
context:
space:
mode:
authorAaron Ballman <aaron@aaronballman.com>2014-03-08 20:12:42 +0000
committerAaron Ballman <aaron@aaronballman.com>2014-03-08 20:12:42 +0000
commite8a8baef44c4df704170c74f6117b8541b1ec752 (patch)
tree4267c871876046245818e1d246fa452cea91004a /clang/lib/CodeGen/TargetInfo.cpp
parent1b91204e3dafe5eb8eafa50ad1d51494ee0ef854 (diff)
downloadbcm5719-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/TargetInfo.cpp')
-rw-r--r--clang/lib/CodeGen/TargetInfo.cpp31
1 files changed, 8 insertions, 23 deletions
diff --git a/clang/lib/CodeGen/TargetInfo.cpp b/clang/lib/CodeGen/TargetInfo.cpp
index db347f86fc6..f9594c8e162 100644
--- a/clang/lib/CodeGen/TargetInfo.cpp
+++ b/clang/lib/CodeGen/TargetInfo.cpp
@@ -214,9 +214,8 @@ static bool isEmptyRecord(ASTContext &Context, QualType T, bool AllowArrays) {
if (!isEmptyRecord(Context, i->getType(), true))
return false;
- for (RecordDecl::field_iterator i = RD->field_begin(), e = RD->field_end();
- i != e; ++i)
- if (!isEmptyField(Context, *i, AllowArrays))
+ for (const auto *I : RD->fields())
+ if (!isEmptyField(Context, I, AllowArrays))
return false;
return true;
}
@@ -261,9 +260,7 @@ static const Type *isSingleElementStruct(QualType T, ASTContext &Context) {
}
// Check for single element.
- 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()) {
QualType FT = FD->getType();
// Ignore empty fields.
@@ -339,10 +336,7 @@ static bool canExpandIndirectArgument(QualType Ty, ASTContext &Context) {
uint64_t Size = 0;
- 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()) {
if (!is32Or64BitBasicType(FD->getType(), Context))
return false;
@@ -678,10 +672,7 @@ bool X86_32ABIInfo::shouldReturnTypeInRegister(QualType Ty, ASTContext &Context,
// Structure types are passed in register if all fields would be
// passed in a register.
- for (RecordDecl::field_iterator i = RT->getDecl()->field_begin(),
- e = RT->getDecl()->field_end(); i != e; ++i) {
- const FieldDecl *FD = *i;
-
+ for (const auto *FD : RT->getDecl()->fields()) {
// Empty fields are ignored.
if (isEmptyField(Context, FD, true))
continue;
@@ -795,8 +786,7 @@ static bool isRecordWithSSEVectorType(ASTContext &Context, QualType Ty) {
if (!isRecordWithSSEVectorType(Context, i->getType()))
return false;
- for (RecordDecl::field_iterator i = RD->field_begin(), e = RD->field_end();
- i != e; ++i) {
+ for (const auto *i : RD->fields()) {
QualType FT = i->getType();
if (isSSEVectorType(Context, FT))
@@ -3405,9 +3395,7 @@ static bool isHomogeneousAggregate(QualType Ty, const Type *&Base,
return false;
Members = 0;
- 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()) {
uint64_t FldMembers;
if (!isHomogeneousAggregate(FD->getType(), Base, Context, &FldMembers))
return false;
@@ -4609,10 +4597,7 @@ bool SystemZABIInfo::isFPArgumentType(QualType Ty) const {
}
// Check the fields.
- 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()) {
// Empty bitfields don't affect things either way.
// Unlike isSingleElementStruct(), empty structure and array fields
// do count. So do anonymous bitfields that aren't zero-sized.
OpenPOWER on IntegriCloud