@@ -442,15 +442,14 @@ void ASTDumper::dumpTemplateParameters(const TemplateParameterList *TPL) {
442
442
if (!TPL)
443
443
return ;
444
444
445
- for (TemplateParameterList::const_iterator I = TPL->begin (), E = TPL->end ();
446
- I != E; ++I)
447
- dumpDecl (*I);
445
+ for (const auto &TP : *TPL)
446
+ dumpDecl (TP);
448
447
}
449
448
450
449
void ASTDumper::dumpTemplateArgumentListInfo (
451
450
const TemplateArgumentListInfo &TALI) {
452
- for (unsigned i = 0 , e = TALI.size (); i < e; ++i )
453
- dumpTemplateArgumentLoc (TALI[i] );
451
+ for (const auto &TA : TALI.arguments () )
452
+ dumpTemplateArgumentLoc (TA );
454
453
}
455
454
456
455
void ASTDumper::dumpTemplateArgumentLoc (const TemplateArgumentLoc &A,
@@ -495,9 +494,8 @@ void ASTDumper::dumpDecl(const Decl *D) {
495
494
496
495
ConstDeclVisitor<ASTDumper>::Visit (D);
497
496
498
- for (Decl::attr_iterator I = D->attr_begin (), E = D->attr_end (); I != E;
499
- ++I)
500
- dumpAttr (*I);
497
+ for (const auto &A : D->attrs ())
498
+ dumpAttr (A);
501
499
502
500
if (const FullComment *Comment =
503
501
D->getASTContext ().getLocalCommentForDeclUncached (D))
@@ -1264,10 +1262,8 @@ void ASTDumper::VisitObjCCategoryDecl(const ObjCCategoryDecl *D) {
1264
1262
NodeDumper.dumpName (D);
1265
1263
NodeDumper.dumpDeclRef (D->getClassInterface ());
1266
1264
NodeDumper.dumpDeclRef (D->getImplementation ());
1267
- for (ObjCCategoryDecl::protocol_iterator I = D->protocol_begin (),
1268
- E = D->protocol_end ();
1269
- I != E; ++I)
1270
- NodeDumper.dumpDeclRef (*I);
1265
+ for (const auto *P : D->protocols ())
1266
+ NodeDumper.dumpDeclRef (P);
1271
1267
dumpObjCTypeParamList (D->getTypeParamList ());
1272
1268
}
1273
1269
@@ -1298,10 +1294,8 @@ void ASTDumper::VisitObjCImplementationDecl(const ObjCImplementationDecl *D) {
1298
1294
NodeDumper.dumpName (D);
1299
1295
NodeDumper.dumpDeclRef (D->getSuperClass (), " super" );
1300
1296
NodeDumper.dumpDeclRef (D->getClassInterface ());
1301
- for (ObjCImplementationDecl::init_const_iterator I = D->init_begin (),
1302
- E = D->init_end ();
1303
- I != E; ++I)
1304
- dumpCXXCtorInitializer (*I);
1297
+ for (const auto &I : D->inits ())
1298
+ dumpCXXCtorInitializer (I);
1305
1299
}
1306
1300
1307
1301
void ASTDumper::VisitObjCCompatibleAliasDecl (const ObjCCompatibleAliasDecl *D) {
@@ -1407,17 +1401,13 @@ void ASTDumper::dumpStmt(const Stmt *S, StringRef Label) {
1407
1401
}
1408
1402
1409
1403
void ASTDumper::VisitDeclStmt (const DeclStmt *Node) {
1410
- for (DeclStmt::const_decl_iterator I = Node->decl_begin (),
1411
- E = Node->decl_end ();
1412
- I != E; ++I)
1413
- dumpDecl (*I);
1404
+ for (const auto &D : Node->decls ())
1405
+ dumpDecl (D);
1414
1406
}
1415
1407
1416
1408
void ASTDumper::VisitAttributedStmt (const AttributedStmt *Node) {
1417
- for (ArrayRef<const Attr *>::iterator I = Node->getAttrs ().begin (),
1418
- E = Node->getAttrs ().end ();
1419
- I != E; ++I)
1420
- dumpAttr (*I);
1409
+ for (const auto *A : Node->getAttrs ())
1410
+ dumpAttr (A);
1421
1411
}
1422
1412
1423
1413
void ASTDumper::VisitCXXCatchStmt (const CXXCatchStmt *Node) {
0 commit comments