diff options
-rw-r--r-- | clang/lib/AST/ASTDumper.cpp | 7 | ||||
-rw-r--r-- | clang/lib/AST/TextNodeDumper.cpp | 11 | ||||
-rw-r--r-- | clang/test/AST/ast-dump-undeserialized.cpp | 3 |
3 files changed, 12 insertions, 9 deletions
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 << "<undeserialized declarations>"; - }); - } } 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<FunctionDecl>(D)) if (FD->isConstexpr()) OS << " constexpr"; + + if (!isa<FunctionDecl>(*D)) { + const auto *MD = dyn_cast<ObjCMethodDecl>(D); + if (!MD || !MD->isThisDeclarationADefinition()) { + const auto *DC = dyn_cast<DeclContext>(D); + if (DC && DC->hasExternalLexicalStorage()) { + ColorScope Color(OS, ShowColors, UndeserializedColor); + OS << " <undeserialized declarations>"; + } + } + } } void TextNodeDumper::Visit(const CXXCtorInitializer *Init) { diff --git a/clang/test/AST/ast-dump-undeserialized.cpp b/clang/test/AST/ast-dump-undeserialized.cpp index 12fccf4a05d..05f4a28e83c 100644 --- a/clang/test/AST/ast-dump-undeserialized.cpp +++ b/clang/test/AST/ast-dump-undeserialized.cpp @@ -1,4 +1,3 @@ // RUN: %clang_cc1 %s -chain-include %s -ast-dump | FileCheck -strict-whitespace %s -// CHECK: TranslationUnitDecl 0x{{.+}} <<invalid sloc>> <invalid sloc> -// CHECK: `-<undeserialized declarations> +// CHECK: TranslationUnitDecl 0x{{.+}} <<invalid sloc>> <invalid sloc> <undeserialized declarations> |