Skip to content

Commit d7f7fb6

Browse files
committed
[clang][AST] TextNodeDumper learned to output instantiated_from information
Reviewed By: aaron.ballman Differential Revision: https://reviews.llvm.org/D158165
1 parent ca1295c commit d7f7fb6

File tree

2 files changed

+314
-305
lines changed

2 files changed

+314
-305
lines changed

clang/lib/AST/TextNodeDumper.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1892,6 +1892,11 @@ void TextNodeDumper::VisitFunctionDecl(const FunctionDecl *D) {
18921892
// ParmVarDecls yet.
18931893
if (!D->param_empty() && !D->param_begin())
18941894
OS << " <<<NULL params x " << D->getNumParams() << ">>>";
1895+
1896+
if (const auto *Instance = D->getInstantiatedFromMemberFunction()) {
1897+
OS << " instantiated_from";
1898+
dumpPointer(Instance);
1899+
}
18951900
}
18961901

18971902
void TextNodeDumper::VisitLifetimeExtendedTemporaryDecl(
@@ -2107,6 +2112,10 @@ void TextNodeDumper::VisitTypeAliasTemplateDecl(
21072112

21082113
void TextNodeDumper::VisitCXXRecordDecl(const CXXRecordDecl *D) {
21092114
VisitRecordDecl(D);
2115+
if (const auto *Instance = D->getInstantiatedFromMemberClass()) {
2116+
OS << " instantiated_from";
2117+
dumpPointer(Instance);
2118+
}
21102119
if (const auto *CTSD = dyn_cast<ClassTemplateSpecializationDecl>(D))
21112120
dumpTemplateSpecializationKind(CTSD->getSpecializationKind());
21122121

0 commit comments

Comments
 (0)