r352663 - [ASTDump] Make method definition order matches declaration order
Stephen Kelly via cfe-commits
cfe-commits at lists.llvm.org
Wed Jan 30 12:06:52 PST 2019
Author: steveire
Date: Wed Jan 30 12:06:52 2019
New Revision: 352663
URL: http://llvm.org/viewvc/llvm-project?rev=352663&view=rev
Log:
[ASTDump] Make method definition order matches declaration order
This will make follow-up changes easier to review.
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=352663&r1=352662&r2=352663&view=diff
==============================================================================
--- cfe/trunk/lib/AST/ASTDumper.cpp (original)
+++ cfe/trunk/lib/AST/ASTDumper.cpp Wed Jan 30 12:06:52 2019
@@ -96,12 +96,6 @@ namespace {
const Decl *From = nullptr,
const char *Label = nullptr);
void dumpTemplateArgumentList(const TemplateArgumentList &TAL);
- template <typename SpecializationDecl>
- void dumpTemplateDeclSpecialization(const SpecializationDecl *D,
- bool DumpExplicitInst,
- bool DumpRefOnly);
- template <typename TemplateDecl>
- void dumpTemplateDecl(const TemplateDecl *D, bool DumpExplicitInst);
// Objective-C utilities.
void dumpObjCTypeParamList(const ObjCTypeParamList *typeParams);
@@ -215,6 +209,13 @@ namespace {
void VisitOMPDeclareReductionDecl(const OMPDeclareReductionDecl *D);
void VisitOMPCapturedExprDecl(const OMPCapturedExprDecl *D);
+ template <typename SpecializationDecl>
+ void dumpTemplateDeclSpecialization(const SpecializationDecl *D,
+ bool DumpExplicitInst,
+ bool DumpRefOnly);
+ template <typename TemplateDecl>
+ void dumpTemplateDecl(const TemplateDecl *D, bool DumpExplicitInst);
+
// C++ Decls
void VisitTypeAliasDecl(const TypeAliasDecl *D);
void VisitTypeAliasTemplateDecl(const TypeAliasTemplateDecl *D);
@@ -227,8 +228,8 @@ namespace {
const ClassTemplatePartialSpecializationDecl *D);
void VisitClassScopeFunctionSpecializationDecl(
const ClassScopeFunctionSpecializationDecl *D);
- void VisitBuiltinTemplateDecl(const BuiltinTemplateDecl *D);
void VisitVarTemplateDecl(const VarTemplateDecl *D);
+ void VisitBuiltinTemplateDecl(const BuiltinTemplateDecl *D);
void VisitVarTemplateSpecializationDecl(
const VarTemplateSpecializationDecl *D);
void VisitVarTemplatePartialSpecializationDecl(
@@ -605,20 +606,6 @@ void ASTDumper::VisitOMPCapturedExprDecl
// C++ Declarations
//===----------------------------------------------------------------------===//
-void ASTDumper::VisitTypeAliasDecl(const TypeAliasDecl *D) {
- Visit(D->getUnderlyingType());
-}
-
-void ASTDumper::VisitTypeAliasTemplateDecl(const TypeAliasTemplateDecl *D) {
- dumpTemplateParameters(D->getTemplateParameters());
- Visit(D->getTemplatedDecl());
-}
-
-void ASTDumper::VisitStaticAssertDecl(const StaticAssertDecl *D) {
- Visit(D->getAssertExpr());
- Visit(D->getMessage());
-}
-
template <typename SpecializationDecl>
void ASTDumper::dumpTemplateDeclSpecialization(const SpecializationDecl *D,
bool DumpExplicitInst,
@@ -672,6 +659,20 @@ void ASTDumper::dumpTemplateDecl(const T
!D->isCanonicalDecl());
}
+void ASTDumper::VisitTypeAliasDecl(const TypeAliasDecl *D) {
+ Visit(D->getUnderlyingType());
+}
+
+void ASTDumper::VisitTypeAliasTemplateDecl(const TypeAliasTemplateDecl *D) {
+ dumpTemplateParameters(D->getTemplateParameters());
+ Visit(D->getTemplatedDecl());
+}
+
+void ASTDumper::VisitStaticAssertDecl(const StaticAssertDecl *D) {
+ Visit(D->getAssertExpr());
+ Visit(D->getMessage());
+}
+
void ASTDumper::VisitFunctionTemplateDecl(const FunctionTemplateDecl *D) {
// FIXME: We don't add a declaration of a function template specialization
// to its context when it's explicitly instantiated, so dump explicit
More information about the cfe-commits
mailing list