From 25f18bfd4f5481cd91f09aeb6ed48334940f3e9a Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sat, 19 Jan 2019 09:05:55 +0000 Subject: Move decl context dumping to TextNodeDumper Summary: Only an obscure case is moved. Reviewers: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D56829 llvm-svn: 351637 --- clang/lib/AST/ASTDumper.cpp | 7 ------- clang/lib/AST/TextNodeDumper.cpp | 11 +++++++++++ 2 files changed, 11 insertions(+), 7 deletions(-) (limited to 'clang/lib') diff --git a/clang/lib/AST/ASTDumper.cpp b/clang/lib/AST/ASTDumper.cpp index a477ee32694..fc33ff331bb 100644 --- a/clang/lib/AST/ASTDumper.cpp +++ b/clang/lib/AST/ASTDumper.cpp @@ -359,13 +359,6 @@ void ASTDumper::dumpDeclContext(const DeclContext *DC) { for (auto *D : (Deserialize ? DC->decls() : DC->noload_decls())) dumpDecl(D); - - if (DC->hasExternalLexicalStorage()) { - dumpChild([=] { - ColorScope Color(OS, ShowColors, UndeserializedColor); - OS << ""; - }); - } } void ASTDumper::dumpLookups(const DeclContext *DC, bool DumpDecls) { diff --git a/clang/lib/AST/TextNodeDumper.cpp b/clang/lib/AST/TextNodeDumper.cpp index ca2d6b2d057..06beb77f7a9 100644 --- a/clang/lib/AST/TextNodeDumper.cpp +++ b/clang/lib/AST/TextNodeDumper.cpp @@ -255,6 +255,17 @@ void TextNodeDumper::Visit(const Decl *D) { if (const FunctionDecl *FD = dyn_cast(D)) if (FD->isConstexpr()) OS << " constexpr"; + + if (!isa(*D)) { + const auto *MD = dyn_cast(D); + if (!MD || !MD->isThisDeclarationADefinition()) { + const auto *DC = dyn_cast(D); + if (DC && DC->hasExternalLexicalStorage()) { + ColorScope Color(OS, ShowColors, UndeserializedColor); + OS << " "; + } + } + } } void TextNodeDumper::Visit(const CXXCtorInitializer *Init) { -- cgit v1.2.3