@@ -161,7 +161,7 @@ namespace {
161
161
}
162
162
void VisitFunctionProtoType (const FunctionProtoType *T) {
163
163
VisitFunctionType (T);
164
- for (QualType PT : T->getParamTypes ())
164
+ for (const QualType & PT : T->getParamTypes ())
165
165
dumpTypeAsChild (PT);
166
166
}
167
167
void VisitTypeOfExprType (const TypeOfExprType *T) {
@@ -186,7 +186,7 @@ namespace {
186
186
dumpTemplateArgument (T->getArgumentPack ());
187
187
}
188
188
void VisitTemplateSpecializationType (const TemplateSpecializationType *T) {
189
- for (auto &Arg : *T)
189
+ for (const auto &Arg : *T)
190
190
dumpTemplateArgument (Arg);
191
191
if (T->isTypeAlias ())
192
192
dumpTypeAsChild (T->getAliasedType ());
@@ -357,7 +357,7 @@ void ASTDumper::dumpDeclContext(const DeclContext *DC) {
357
357
if (!DC)
358
358
return ;
359
359
360
- for (auto *D : (Deserialize ? DC->decls () : DC->noload_decls ()))
360
+ for (const auto *D : (Deserialize ? DC->decls () : DC->noload_decls ()))
361
361
dumpDecl (D);
362
362
}
363
363
@@ -478,7 +478,7 @@ void ASTDumper::dumpObjCTypeParamList(const ObjCTypeParamList *typeParams) {
478
478
if (!typeParams)
479
479
return ;
480
480
481
- for (auto typeParam : *typeParams) {
481
+ for (const auto & typeParam : *typeParams) {
482
482
dumpDecl (typeParam);
483
483
}
484
484
}
@@ -555,7 +555,7 @@ void ASTDumper::VisitIndirectFieldDecl(const IndirectFieldDecl *D) {
555
555
NodeDumper.dumpName (D);
556
556
NodeDumper.dumpType (D->getType ());
557
557
558
- for (auto *Child : D->chain ())
558
+ for (const auto *Child : D->chain ())
559
559
NodeDumper.dumpDeclRef (Child);
560
560
}
561
561
@@ -688,14 +688,14 @@ void ASTDumper::VisitVarDecl(const VarDecl *D) {
688
688
689
689
void ASTDumper::VisitDecompositionDecl (const DecompositionDecl *D) {
690
690
VisitVarDecl (D);
691
- for (auto *B : D->bindings ())
691
+ for (const auto *B : D->bindings ())
692
692
dumpDecl (B);
693
693
}
694
694
695
695
void ASTDumper::VisitBindingDecl (const BindingDecl *D) {
696
696
NodeDumper.dumpName (D);
697
697
NodeDumper.dumpType (D->getType ());
698
- if (auto *E = D->getBinding ())
698
+ if (const auto *E = D->getBinding ())
699
699
dumpStmt (E);
700
700
}
701
701
@@ -736,7 +736,7 @@ void ASTDumper::VisitCapturedDecl(const CapturedDecl *D) {
736
736
// ===----------------------------------------------------------------------===//
737
737
738
738
void ASTDumper::VisitOMPThreadPrivateDecl (const OMPThreadPrivateDecl *D) {
739
- for (auto *E : D->varlists ())
739
+ for (const auto *E : D->varlists ())
740
740
dumpStmt (E);
741
741
}
742
742
@@ -766,7 +766,7 @@ void ASTDumper::VisitOMPDeclareReductionDecl(const OMPDeclareReductionDecl *D) {
766
766
}
767
767
768
768
void ASTDumper::VisitOMPRequiresDecl (const OMPRequiresDecl *D) {
769
- for (auto *C : D->clauselists ()) {
769
+ for (const auto *C : D->clauselists ()) {
770
770
dumpChild ([=] {
771
771
if (!C) {
772
772
ColorScope Color (OS, ShowColors, NullColor);
@@ -974,7 +974,7 @@ void ASTDumper::dumpTemplateDeclSpecialization(const SpecializationDecl *D,
974
974
bool DumpExplicitInst,
975
975
bool DumpRefOnly) {
976
976
bool DumpedAny = false ;
977
- for (auto *RedeclWithBadType : D->redecls ()) {
977
+ for (const auto *RedeclWithBadType : D->redecls ()) {
978
978
// FIXME: The redecls() range sometimes has elements of a less-specific
979
979
// type. (In particular, ClassTemplateSpecializationDecl::redecls() gives
980
980
// us TagDecls, and should give CXXRecordDecls).
@@ -1018,7 +1018,7 @@ void ASTDumper::dumpTemplateDecl(const TemplateDecl *D, bool DumpExplicitInst) {
1018
1018
1019
1019
dumpDecl (D->getTemplatedDecl ());
1020
1020
1021
- for (auto *Child : D->specializations ())
1021
+ for (const auto *Child : D->specializations ())
1022
1022
dumpTemplateDeclSpecialization (Child, DumpExplicitInst,
1023
1023
!D->isCanonicalDecl ());
1024
1024
}
@@ -1280,7 +1280,7 @@ void ASTDumper::VisitObjCCategoryImplDecl(const ObjCCategoryImplDecl *D) {
1280
1280
void ASTDumper::VisitObjCProtocolDecl (const ObjCProtocolDecl *D) {
1281
1281
NodeDumper.dumpName (D);
1282
1282
1283
- for (auto *Child : D->protocols ())
1283
+ for (const auto *Child : D->protocols ())
1284
1284
NodeDumper.dumpDeclRef (Child);
1285
1285
}
1286
1286
@@ -1289,7 +1289,7 @@ void ASTDumper::VisitObjCInterfaceDecl(const ObjCInterfaceDecl *D) {
1289
1289
NodeDumper.dumpDeclRef (D->getSuperClass (), " super" );
1290
1290
1291
1291
NodeDumper.dumpDeclRef (D->getImplementation ());
1292
- for (auto *Child : D->protocols ())
1292
+ for (const auto *Child : D->protocols ())
1293
1293
NodeDumper.dumpDeclRef (Child);
1294
1294
dumpObjCTypeParamList (D->getTypeParamListAsWritten ());
1295
1295
}
@@ -1374,7 +1374,7 @@ void ASTDumper::VisitBlockDecl(const BlockDecl *D) {
1374
1374
if (D->capturesCXXThis ())
1375
1375
OS << " captures_this" ;
1376
1376
1377
- for (auto I : D->parameters ())
1377
+ for (const auto & I : D->parameters ())
1378
1378
dumpDecl (I);
1379
1379
1380
1380
for (const auto &I : D->captures ())
@@ -1435,7 +1435,7 @@ void ASTDumper::VisitCapturedStmt(const CapturedStmt *Node) {
1435
1435
void ASTDumper::Visit (const OMPClause *C) {
1436
1436
dumpChild ([=] {
1437
1437
NodeDumper.Visit (C);
1438
- for (auto *S : C->children ())
1438
+ for (const auto *S : C->children ())
1439
1439
dumpStmt (S);
1440
1440
});
1441
1441
}
0 commit comments