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/CGExprConstant.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/CGExprConstant.cpp')
| -rw-r--r-- | lib/CodeGen/CGExprConstant.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/lib/CodeGen/CGExprConstant.cpp b/lib/CodeGen/CGExprConstant.cpp index 4fff49cb03..2df5de0644 100644 --- a/lib/CodeGen/CGExprConstant.cpp +++ b/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; } |
