This revision was automatically updated to reflect the committed changes. Closed by commit rC351269: Re-order overrides in FunctionDecl dump (authored by steveire, committed by ).
Changed prior to commit: https://reviews.llvm.org/D55083?vs=181744&id=181892#toc Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55083/new/ https://reviews.llvm.org/D55083 Files: lib/AST/ASTDumper.cpp test/AST/ast-dump-funcs.cpp Index: lib/AST/ASTDumper.cpp =================================================================== --- lib/AST/ASTDumper.cpp +++ lib/AST/ASTDumper.cpp @@ -612,20 +612,6 @@ } } - 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 @@ } } + 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()); } Index: test/AST/ast-dump-funcs.cpp =================================================================== --- test/AST/ast-dump-funcs.cpp +++ test/AST/ast-dump-funcs.cpp @@ -56,10 +56,10 @@ struct T : S { // T is not referenced, but S is void f(float, int = 100) override; // CHECK: CXXMethodDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:3, col:28> col:8 f 'void (float, int)' + // CHECK-NEXT: Overrides: [ 0x{{[^ ]*}} S::f 'void (float, int)' ] // CHECK-NEXT: ParmVarDecl 0x{{[^ ]*}} <col:10> col:15 'float' // CHECK-NEXT: ParmVarDecl 0x{{[^ ]*}} <col:17, col:23> col:21 'int' cinit // CHECK-NEXT: IntegerLiteral 0x{{[^ ]*}} <col:23> 'int' 100 - // CHECK-NEXT: Overrides: [ 0x{{[^ ]*}} S::f 'void (float, int)' ] // CHECK-NEXT: OverrideAttr // CHECK: CXXConstructorDecl 0x{{[^ ]*}} <line:[[@LINE-9]]:8> col:8 implicit T 'void (const T &)' inline default_delete noexcept-unevaluated
Index: lib/AST/ASTDumper.cpp =================================================================== --- lib/AST/ASTDumper.cpp +++ lib/AST/ASTDumper.cpp @@ -612,20 +612,6 @@ } } - 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 @@ } } + 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()); } Index: test/AST/ast-dump-funcs.cpp =================================================================== --- test/AST/ast-dump-funcs.cpp +++ test/AST/ast-dump-funcs.cpp @@ -56,10 +56,10 @@ struct T : S { // T is not referenced, but S is void f(float, int = 100) override; // CHECK: CXXMethodDecl 0x{{[^ ]*}} <line:[[@LINE-1]]:3, col:28> col:8 f 'void (float, int)' + // CHECK-NEXT: Overrides: [ 0x{{[^ ]*}} S::f 'void (float, int)' ] // CHECK-NEXT: ParmVarDecl 0x{{[^ ]*}} <col:10> col:15 'float' // CHECK-NEXT: ParmVarDecl 0x{{[^ ]*}} <col:17, col:23> col:21 'int' cinit // CHECK-NEXT: IntegerLiteral 0x{{[^ ]*}} <col:23> 'int' 100 - // CHECK-NEXT: Overrides: [ 0x{{[^ ]*}} S::f 'void (float, int)' ] // CHECK-NEXT: OverrideAttr // CHECK: CXXConstructorDecl 0x{{[^ ]*}} <line:[[@LINE-9]]:8> col:8 implicit T 'void (const T &)' inline default_delete noexcept-unevaluated
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits