From: Stephen Kelly Date: Tue, 15 Jan 2019 23:05:11 +0000 (+0000) Subject: NFC: Some cleanups that I missed in the previous commit X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4d91a8997233c6bfa2dd63e2627dded41f5558c9;p=clang NFC: Some cleanups that I missed in the previous commit git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@351271 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/AST/ASTDumper.cpp b/lib/AST/ASTDumper.cpp index f982b1fbe3..4dcd20e4f5 100644 --- a/lib/AST/ASTDumper.cpp +++ b/lib/AST/ASTDumper.cpp @@ -599,7 +599,7 @@ void ASTDumper::VisitFunctionDecl(const FunctionDecl *D) { if (D->isTrivial()) OS << " trivial"; - if (const FunctionProtoType *FPT = D->getType()->getAs()) { + if (const auto *FPT = D->getType()->getAs()) { FunctionProtoType::ExtProtoInfo EPI = FPT->getExtProtoInfo(); switch (EPI.ExceptionSpec.Type) { default: break; @@ -612,7 +612,7 @@ void ASTDumper::VisitFunctionDecl(const FunctionDecl *D) { } } - if (const CXXMethodDecl *MD = dyn_cast(D)) { + if (const auto *MD = dyn_cast(D)) { if (MD->size_overridden_methods() != 0) { auto dumpOverride = [=](const CXXMethodDecl *D) { SplitQualType T_split = D->getType().split(); @@ -635,8 +635,7 @@ void ASTDumper::VisitFunctionDecl(const FunctionDecl *D) { } } - if (const FunctionTemplateSpecializationInfo *FTSI = - D->getTemplateSpecializationInfo()) + if (const auto *FTSI = D->getTemplateSpecializationInfo()) dumpTemplateArgumentList(*FTSI->TemplateArguments); if (!D->param_begin() && D->getNumParams()) @@ -645,11 +644,9 @@ void ASTDumper::VisitFunctionDecl(const FunctionDecl *D) { for (const ParmVarDecl *Parameter : D->parameters()) dumpDecl(Parameter); - if (const CXXConstructorDecl *C = dyn_cast(D)) - for (CXXConstructorDecl::init_const_iterator I = C->init_begin(), - E = C->init_end(); - I != E; ++I) - dumpCXXCtorInitializer(*I); + if (const auto *C = dyn_cast(D)) + for (const auto *I : C->inits()) + dumpCXXCtorInitializer(I); if (D->doesThisDeclarationHaveABody()) dumpStmt(D->getBody());