summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGExprConstant.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/CGExprConstant.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/CGExprConstant.cpp')
-rw-r--r--clang/lib/CodeGen/CGExprConstant.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/clang/lib/CodeGen/CGExprConstant.cpp b/clang/lib/CodeGen/CGExprConstant.cpp
index 4fff49cb030..2df5de06449 100644
--- a/clang/lib/CodeGen/CGExprConstant.cpp
+++ b/clang/lib/CodeGen/CGExprConstant.cpp
@@ -1359,19 +1359,16 @@ static llvm::Constant *EmitNullConstant(CodeGenModule &CGM,
}
// Fill in all the fields.
- for (RecordDecl::field_iterator I = record->field_begin(),
- E = record->field_end(); I != E; ++I) {
- const FieldDecl *field = *I;
-
+ for (const auto *Field : record->fields()) {
// Fill in non-bitfields. (Bitfields always use a zero pattern, which we
// will fill in later.)
- if (!field->isBitField()) {
- unsigned fieldIndex = layout.getLLVMFieldNo(field);
- elements[fieldIndex] = CGM.EmitNullConstant(field->getType());
+ if (!Field->isBitField()) {
+ unsigned fieldIndex = layout.getLLVMFieldNo(Field);
+ elements[fieldIndex] = CGM.EmitNullConstant(Field->getType());
}
// For unions, stop after the first named field.
- if (record->isUnion() && field->getDeclName())
+ if (record->isUnion() && Field->getDeclName())
break;
}
OpenPOWER on IntegriCloud