summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/ASTContext.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/AST/ASTContext.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/AST/ASTContext.cpp')
-rw-r--r--clang/lib/AST/ASTContext.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index d3a82c4dc5e..12c7331a998 100644
--- a/clang/lib/AST/ASTContext.cpp
+++ b/clang/lib/AST/ASTContext.cpp
@@ -5369,9 +5369,7 @@ void ASTContext::getObjCEncodingForTypeImpl(QualType T, std::string& S,
if (!RDecl->isUnion()) {
getObjCEncodingForStructureImpl(RDecl, S, FD);
} else {
- for (RecordDecl::field_iterator Field = RDecl->field_begin(),
- FieldEnd = RDecl->field_end();
- Field != FieldEnd; ++Field) {
+ for (const auto *Field : RDecl->fields()) {
if (FD) {
S += '"';
S += Field->getNameAsString();
@@ -5381,7 +5379,7 @@ void ASTContext::getObjCEncodingForTypeImpl(QualType T, std::string& S,
// Special case bit-fields.
if (Field->isBitField()) {
getObjCEncodingForTypeImpl(Field->getType(), S, false, true,
- *Field);
+ Field);
} else {
QualType qt = Field->getType();
getLegacyIntegralTypeEncoding(qt);
@@ -6845,9 +6843,8 @@ QualType ASTContext::mergeTransparentUnionType(QualType T, QualType SubType,
if (const RecordType *UT = T->getAsUnionType()) {
RecordDecl *UD = UT->getDecl();
if (UD->hasAttr<TransparentUnionAttr>()) {
- for (RecordDecl::field_iterator it = UD->field_begin(),
- itend = UD->field_end(); it != itend; ++it) {
- QualType ET = it->getType().getUnqualifiedType();
+ for (const auto *I : UD->fields()) {
+ QualType ET = I->getType().getUnqualifiedType();
QualType MT = mergeTypes(ET, SubType, OfBlockPointer, Unqualified);
if (!MT.isNull())
return MT;
OpenPOWER on IntegriCloud