diff options
author | Stephen Kelly <steveire@gmail.com> | 2019-01-15 22:50:37 +0000 |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2019-01-15 22:50:37 +0000 |
commit | 42d9950073fd0ee20a9c21bb12737d3f1c38d28d (patch) | |
tree | ad3c739c570160138c5ddc7c1ab9f45269caed5e /clang/lib/AST/ASTDumper.cpp | |
parent | b418937793e81fc7541ce2eb322611ce40d43b3e (diff) | |
download | bcm5719-llvm-42d9950073fd0ee20a9c21bb12737d3f1c38d28d.tar.gz bcm5719-llvm-42d9950073fd0ee20a9c21bb12737d3f1c38d28d.zip |
Re-order overrides in FunctionDecl dump
Output all content which is local to the FunctionDecl before traversing
to child AST nodes.
This is necessary so that all of the part which is local to the
FunctionDecl can be split into a different method.
Reviewers: aaron.ballman
Differential Revision: https://reviews.llvm.org/D55083
llvm-svn: 351269
Diffstat (limited to 'clang/lib/AST/ASTDumper.cpp')
-rw-r--r-- | clang/lib/AST/ASTDumper.cpp | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/clang/lib/AST/ASTDumper.cpp b/clang/lib/AST/ASTDumper.cpp index bd7571b5366..f982b1fbe36 100644 --- a/clang/lib/AST/ASTDumper.cpp +++ b/clang/lib/AST/ASTDumper.cpp @@ -612,20 +612,6 @@ void ASTDumper::VisitFunctionDecl(const FunctionDecl *D) { } } - if (const FunctionTemplateSpecializationInfo *FTSI = - D->getTemplateSpecializationInfo()) - dumpTemplateArgumentList(*FTSI->TemplateArguments); - - if (!D->param_begin() && D->getNumParams()) - dumpChild([=] { OS << "<<NULL params x " << D->getNumParams() << ">>"; }); - else - for (const ParmVarDecl *Parameter : D->parameters()) - dumpDecl(Parameter); - - if (const CXXConstructorDecl *C = dyn_cast<CXXConstructorDecl>(D)) - for (const auto *I : C->inits()) - dumpCXXCtorInitializer(I); - if (const CXXMethodDecl *MD = dyn_cast<CXXMethodDecl>(D)) { if (MD->size_overridden_methods() != 0) { auto dumpOverride = [=](const CXXMethodDecl *D) { @@ -649,6 +635,22 @@ void ASTDumper::VisitFunctionDecl(const FunctionDecl *D) { } } + if (const FunctionTemplateSpecializationInfo *FTSI = + D->getTemplateSpecializationInfo()) + dumpTemplateArgumentList(*FTSI->TemplateArguments); + + if (!D->param_begin() && D->getNumParams()) + dumpChild([=] { OS << "<<NULL params x " << D->getNumParams() << ">>"; }); + else + 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 (D->doesThisDeclarationHaveABody()) dumpStmt(D->getBody()); } |