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/CGClass.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/CGClass.cpp')
| -rw-r--r-- | lib/CodeGen/CGClass.cpp | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/lib/CodeGen/CGClass.cpp b/lib/CodeGen/CGClass.cpp index cc8f20c0e9..92400b1b39 100644 --- a/lib/CodeGen/CGClass.cpp +++ b/lib/CodeGen/CGClass.cpp @@ -1195,13 +1195,9 @@ HasTrivialDestructorBody(ASTContext &Context, return false; // Check fields. - for (CXXRecordDecl::field_iterator I = BaseClassDecl->field_begin(), - E = BaseClassDecl->field_end(); I != E; ++I) { - const FieldDecl *Field = *I; - + for (const auto *Field : BaseClassDecl->fields()) if (!FieldHasTrivialDestructorBody(Context, Field)) return false; - } // Check non-virtual bases. for (CXXRecordDecl::base_class_const_iterator I = @@ -1256,13 +1252,9 @@ static bool CanSkipVTablePointerInitialization(ASTContext &Context, // Check the fields. const CXXRecordDecl *ClassDecl = Dtor->getParent(); - for (CXXRecordDecl::field_iterator I = ClassDecl->field_begin(), - E = ClassDecl->field_end(); I != E; ++I) { - const FieldDecl *Field = *I; - + for (const auto *Field : ClassDecl->fields()) if (!FieldHasTrivialDestructorBody(Context, Field)) return false; - } return true; } @@ -1512,10 +1504,8 @@ void CodeGenFunction::EnterDtorCleanups(const CXXDestructorDecl *DD, } // Destroy direct fields. - for (CXXRecordDecl::field_iterator I = ClassDecl->field_begin(), - E = ClassDecl->field_end(); I != E; ++I) { - const FieldDecl *field = *I; - QualType type = field->getType(); + for (const auto *Field : ClassDecl->fields()) { + QualType type = Field->getType(); QualType::DestructionKind dtorKind = type.isDestructedType(); if (!dtorKind) continue; @@ -1524,7 +1514,7 @@ void CodeGenFunction::EnterDtorCleanups(const CXXDestructorDecl *DD, if (RT && RT->getDecl()->isAnonymousStructOrUnion()) continue; CleanupKind cleanupKind = getCleanupKind(dtorKind); - EHStack.pushCleanup<DestroyField>(cleanupKind, field, + EHStack.pushCleanup<DestroyField>(cleanupKind, Field, getDestroyer(dtorKind), cleanupKind & EHCleanup); } |
