r351271 - NFC: Some cleanups that I missed in the previous commit
Stephen Kelly via cfe-commits
cfe-commits at lists.llvm.org
Tue Jan 15 15:05:12 PST 2019
Author: steveire
Date: Tue Jan 15 15:05:11 2019
New Revision: 351271
URL: http://llvm.org/viewvc/llvm-project?rev=351271&view=rev
Log:
NFC: Some cleanups that I missed in the previous commit
Modified:
cfe/trunk/lib/AST/ASTDumper.cpp
Modified: cfe/trunk/lib/AST/ASTDumper.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTDumper.cpp?rev=351271&r1=351270&r2=351271&view=diff
==============================================================================
--- cfe/trunk/lib/AST/ASTDumper.cpp (original)
+++ cfe/trunk/lib/AST/ASTDumper.cpp Tue Jan 15 15:05:11 2019
@@ -599,7 +599,7 @@ void ASTDumper::VisitFunctionDecl(const
if (D->isTrivial())
OS << " trivial";
- if (const FunctionProtoType *FPT = D->getType()->getAs<FunctionProtoType>()) {
+ if (const auto *FPT = D->getType()->getAs<FunctionProtoType>()) {
FunctionProtoType::ExtProtoInfo EPI = FPT->getExtProtoInfo();
switch (EPI.ExceptionSpec.Type) {
default: break;
@@ -612,7 +612,7 @@ void ASTDumper::VisitFunctionDecl(const
}
}
- if (const CXXMethodDecl *MD = dyn_cast<CXXMethodDecl>(D)) {
+ if (const auto *MD = dyn_cast<CXXMethodDecl>(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
}
}
- 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
for (const ParmVarDecl *Parameter : D->parameters())
dumpDecl(Parameter);
- if (const CXXConstructorDecl *C = dyn_cast<CXXConstructorDecl>(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<CXXConstructorDecl>(D))
+ for (const auto *I : C->inits())
+ dumpCXXCtorInitializer(I);
if (D->doesThisDeclarationHaveABody())
dumpStmt(D->getBody());
More information about the cfe-commits
mailing list