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/Rewrite | |
parent | 1b91204e3dafe5eb8eafa50ad1d51494ee0ef854 (diff) | |
download | llvm-e8a8baef44c4df704170c74f6117b8541b1ec752.tar.gz |
[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/Rewrite')
-rw-r--r-- | clang/lib/Rewrite/Frontend/RewriteModernObjC.cpp | 9 | ||||
-rw-r--r-- | clang/lib/Rewrite/Frontend/RewriteObjC.cpp | 4 |
2 files changed, 3 insertions, 10 deletions
diff --git a/clang/lib/Rewrite/Frontend/RewriteModernObjC.cpp b/clang/lib/Rewrite/Frontend/RewriteModernObjC.cpp index e0320ba3a23d..d14b78ce2e67 100644 --- a/clang/lib/Rewrite/Frontend/RewriteModernObjC.cpp +++ b/clang/lib/Rewrite/Frontend/RewriteModernObjC.cpp @@ -3788,11 +3788,8 @@ bool RewriteModernObjC::RewriteObjCFieldDeclType(QualType &Type, return true; } Result += " {\n"; - for (RecordDecl::field_iterator i = RD->field_begin(), - e = RD->field_end(); i != e; ++i) { - FieldDecl *FD = *i; + for (auto *FD : RD->fields()) RewriteObjCFieldDecl(FD, Result); - } Result += "\t} "; return true; } @@ -5847,9 +5844,7 @@ Stmt *RewriteModernObjC::RewriteFunctionBodyOrGlobalInitializer(Stmt *S) { } void RewriteModernObjC::RewriteRecordBody(RecordDecl *RD) { - for (RecordDecl::field_iterator i = RD->field_begin(), - e = RD->field_end(); i != e; ++i) { - FieldDecl *FD = *i; + for (auto *FD : RD->fields()) { if (isTopLevelBlockPointerType(FD->getType())) RewriteBlockPointerDecl(FD); if (FD->getType()->isObjCQualifiedIdType() || diff --git a/clang/lib/Rewrite/Frontend/RewriteObjC.cpp b/clang/lib/Rewrite/Frontend/RewriteObjC.cpp index 81752cdd3ef5..91be2b06aedf 100644 --- a/clang/lib/Rewrite/Frontend/RewriteObjC.cpp +++ b/clang/lib/Rewrite/Frontend/RewriteObjC.cpp @@ -4863,9 +4863,7 @@ Stmt *RewriteObjC::RewriteFunctionBodyOrGlobalInitializer(Stmt *S) { } void RewriteObjC::RewriteRecordBody(RecordDecl *RD) { - for (RecordDecl::field_iterator i = RD->field_begin(), - e = RD->field_end(); i != e; ++i) { - FieldDecl *FD = *i; + for (auto *FD : RD->fields()) { if (isTopLevelBlockPointerType(FD->getType())) RewriteBlockPointerDecl(FD); if (FD->getType()->isObjCQualifiedIdType() || |