forked from OSchip/llvm-project
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. llvm-svn: 348720
This commit is contained in:
parent
e26a88aaa8
commit
2413638a6d
|
@ -102,6 +102,12 @@ namespace {
|
||||||
void dumpTemplateArgumentList(const TemplateArgumentList &TAL);
|
void dumpTemplateArgumentList(const TemplateArgumentList &TAL);
|
||||||
void dumpTemplateArgument(const TemplateArgument &A,
|
void dumpTemplateArgument(const TemplateArgument &A,
|
||||||
SourceRange R = SourceRange());
|
SourceRange R = SourceRange());
|
||||||
|
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.
|
// Objective-C utilities.
|
||||||
void dumpObjCTypeParamList(const ObjCTypeParamList *typeParams);
|
void dumpObjCTypeParamList(const ObjCTypeParamList *typeParams);
|
||||||
|
@ -316,12 +322,6 @@ namespace {
|
||||||
void VisitTypeAliasTemplateDecl(const TypeAliasTemplateDecl *D);
|
void VisitTypeAliasTemplateDecl(const TypeAliasTemplateDecl *D);
|
||||||
void VisitCXXRecordDecl(const CXXRecordDecl *D);
|
void VisitCXXRecordDecl(const CXXRecordDecl *D);
|
||||||
void VisitStaticAssertDecl(const StaticAssertDecl *D);
|
void VisitStaticAssertDecl(const StaticAssertDecl *D);
|
||||||
template<typename SpecializationDecl>
|
|
||||||
void VisitTemplateDeclSpecialization(const SpecializationDecl *D,
|
|
||||||
bool DumpExplicitInst,
|
|
||||||
bool DumpRefOnly);
|
|
||||||
template<typename TemplateDecl>
|
|
||||||
void VisitTemplateDecl(const TemplateDecl *D, bool DumpExplicitInst);
|
|
||||||
void VisitFunctionTemplateDecl(const FunctionTemplateDecl *D);
|
void VisitFunctionTemplateDecl(const FunctionTemplateDecl *D);
|
||||||
void VisitClassTemplateDecl(const ClassTemplateDecl *D);
|
void VisitClassTemplateDecl(const ClassTemplateDecl *D);
|
||||||
void VisitClassTemplateSpecializationDecl(
|
void VisitClassTemplateSpecializationDecl(
|
||||||
|
@ -1261,10 +1261,10 @@ void ASTDumper::VisitStaticAssertDecl(const StaticAssertDecl *D) {
|
||||||
dumpStmt(D->getMessage());
|
dumpStmt(D->getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename SpecializationDecl>
|
template <typename SpecializationDecl>
|
||||||
void ASTDumper::VisitTemplateDeclSpecialization(const SpecializationDecl *D,
|
void ASTDumper::dumpTemplateDeclSpecialization(const SpecializationDecl *D,
|
||||||
bool DumpExplicitInst,
|
bool DumpExplicitInst,
|
||||||
bool DumpRefOnly) {
|
bool DumpRefOnly) {
|
||||||
bool DumpedAny = false;
|
bool DumpedAny = false;
|
||||||
for (auto *RedeclWithBadType : D->redecls()) {
|
for (auto *RedeclWithBadType : D->redecls()) {
|
||||||
// FIXME: The redecls() range sometimes has elements of a less-specific
|
// FIXME: The redecls() range sometimes has elements of a less-specific
|
||||||
|
@ -1303,28 +1303,27 @@ void ASTDumper::VisitTemplateDeclSpecialization(const SpecializationDecl *D,
|
||||||
dumpDeclRef(D);
|
dumpDeclRef(D);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename TemplateDecl>
|
template <typename TemplateDecl>
|
||||||
void ASTDumper::VisitTemplateDecl(const TemplateDecl *D,
|
void ASTDumper::dumpTemplateDecl(const TemplateDecl *D, bool DumpExplicitInst) {
|
||||||
bool DumpExplicitInst) {
|
|
||||||
NodeDumper.dumpName(D);
|
NodeDumper.dumpName(D);
|
||||||
dumpTemplateParameters(D->getTemplateParameters());
|
dumpTemplateParameters(D->getTemplateParameters());
|
||||||
|
|
||||||
dumpDecl(D->getTemplatedDecl());
|
dumpDecl(D->getTemplatedDecl());
|
||||||
|
|
||||||
for (auto *Child : D->specializations())
|
for (auto *Child : D->specializations())
|
||||||
VisitTemplateDeclSpecialization(Child, DumpExplicitInst,
|
dumpTemplateDeclSpecialization(Child, DumpExplicitInst,
|
||||||
!D->isCanonicalDecl());
|
!D->isCanonicalDecl());
|
||||||
}
|
}
|
||||||
|
|
||||||
void ASTDumper::VisitFunctionTemplateDecl(const FunctionTemplateDecl *D) {
|
void ASTDumper::VisitFunctionTemplateDecl(const FunctionTemplateDecl *D) {
|
||||||
// FIXME: We don't add a declaration of a function template specialization
|
// FIXME: We don't add a declaration of a function template specialization
|
||||||
// to its context when it's explicitly instantiated, so dump explicit
|
// to its context when it's explicitly instantiated, so dump explicit
|
||||||
// instantiations when we dump the template itself.
|
// instantiations when we dump the template itself.
|
||||||
VisitTemplateDecl(D, true);
|
dumpTemplateDecl(D, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ASTDumper::VisitClassTemplateDecl(const ClassTemplateDecl *D) {
|
void ASTDumper::VisitClassTemplateDecl(const ClassTemplateDecl *D) {
|
||||||
VisitTemplateDecl(D, false);
|
dumpTemplateDecl(D, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ASTDumper::VisitClassTemplateSpecializationDecl(
|
void ASTDumper::VisitClassTemplateSpecializationDecl(
|
||||||
|
@ -1347,7 +1346,7 @@ void ASTDumper::VisitClassScopeFunctionSpecializationDecl(
|
||||||
}
|
}
|
||||||
|
|
||||||
void ASTDumper::VisitVarTemplateDecl(const VarTemplateDecl *D) {
|
void ASTDumper::VisitVarTemplateDecl(const VarTemplateDecl *D) {
|
||||||
VisitTemplateDecl(D, false);
|
dumpTemplateDecl(D, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ASTDumper::VisitBuiltinTemplateDecl(const BuiltinTemplateDecl *D) {
|
void ASTDumper::VisitBuiltinTemplateDecl(const BuiltinTemplateDecl *D) {
|
||||||
|
|
Loading…
Reference in New Issue