From: Stephen Kelly Date: Sun, 9 Dec 2018 13:33:30 +0000 (+0000) Subject: NFC: Rename TemplateDecl dump utilities X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f4ade88ccba4b55eb729cb9d44683883743285bc;p=clang NFC: Rename TemplateDecl dump utilities There is a clang::TemplateDecl AST type, so a method called VisitTemplateDecl looks like it should 'override' the method from the base visitor, but it does not because of the extra parameters it takes. In reality, these methods are utilities, so name them like utilities. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348720 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/AST/ASTDumper.cpp b/lib/AST/ASTDumper.cpp index 353d29cde7..e071575a1e 100644 --- a/lib/AST/ASTDumper.cpp +++ b/lib/AST/ASTDumper.cpp @@ -102,6 +102,12 @@ namespace { void dumpTemplateArgumentList(const TemplateArgumentList &TAL); void dumpTemplateArgument(const TemplateArgument &A, SourceRange R = SourceRange()); + template + void dumpTemplateDeclSpecialization(const SpecializationDecl *D, + bool DumpExplicitInst, + bool DumpRefOnly); + template + void dumpTemplateDecl(const TemplateDecl *D, bool DumpExplicitInst); // Objective-C utilities. void dumpObjCTypeParamList(const ObjCTypeParamList *typeParams); @@ -316,12 +322,6 @@ namespace { void VisitTypeAliasTemplateDecl(const TypeAliasTemplateDecl *D); void VisitCXXRecordDecl(const CXXRecordDecl *D); void VisitStaticAssertDecl(const StaticAssertDecl *D); - template - void VisitTemplateDeclSpecialization(const SpecializationDecl *D, - bool DumpExplicitInst, - bool DumpRefOnly); - template - void VisitTemplateDecl(const TemplateDecl *D, bool DumpExplicitInst); void VisitFunctionTemplateDecl(const FunctionTemplateDecl *D); void VisitClassTemplateDecl(const ClassTemplateDecl *D); void VisitClassTemplateSpecializationDecl( @@ -1261,10 +1261,10 @@ void ASTDumper::VisitStaticAssertDecl(const StaticAssertDecl *D) { dumpStmt(D->getMessage()); } -template -void ASTDumper::VisitTemplateDeclSpecialization(const SpecializationDecl *D, - bool DumpExplicitInst, - bool DumpRefOnly) { +template +void ASTDumper::dumpTemplateDeclSpecialization(const SpecializationDecl *D, + bool DumpExplicitInst, + bool DumpRefOnly) { bool DumpedAny = false; for (auto *RedeclWithBadType : D->redecls()) { // FIXME: The redecls() range sometimes has elements of a less-specific @@ -1303,28 +1303,27 @@ void ASTDumper::VisitTemplateDeclSpecialization(const SpecializationDecl *D, dumpDeclRef(D); } -template -void ASTDumper::VisitTemplateDecl(const TemplateDecl *D, - bool DumpExplicitInst) { +template +void ASTDumper::dumpTemplateDecl(const TemplateDecl *D, bool DumpExplicitInst) { NodeDumper.dumpName(D); dumpTemplateParameters(D->getTemplateParameters()); dumpDecl(D->getTemplatedDecl()); for (auto *Child : D->specializations()) - VisitTemplateDeclSpecialization(Child, DumpExplicitInst, - !D->isCanonicalDecl()); + dumpTemplateDeclSpecialization(Child, DumpExplicitInst, + !D->isCanonicalDecl()); } 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 // instantiations when we dump the template itself. - VisitTemplateDecl(D, true); + dumpTemplateDecl(D, true); } void ASTDumper::VisitClassTemplateDecl(const ClassTemplateDecl *D) { - VisitTemplateDecl(D, false); + dumpTemplateDecl(D, false); } void ASTDumper::VisitClassTemplateSpecializationDecl( @@ -1347,7 +1346,7 @@ void ASTDumper::VisitClassScopeFunctionSpecializationDecl( } void ASTDumper::VisitVarTemplateDecl(const VarTemplateDecl *D) { - VisitTemplateDecl(D, false); + dumpTemplateDecl(D, false); } void ASTDumper::VisitBuiltinTemplateDecl(const BuiltinTemplateDecl *D) {