summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2019-01-19 09:05:55 +0000
committerStephen Kelly <steveire@gmail.com>2019-01-19 09:05:55 +0000
commit25f18bfd4f5481cd91f09aeb6ed48334940f3e9a (patch)
tree1d2dcebd23fa21deae64cf07a1e0290092ef79bc
parent2946cd701067404b99c39fb29dc9c74bd7193eb3 (diff)
downloadbcm5719-llvm-25f18bfd4f5481cd91f09aeb6ed48334940f3e9a.tar.gz
bcm5719-llvm-25f18bfd4f5481cd91f09aeb6ed48334940f3e9a.zip
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
-rw-r--r--clang/lib/AST/ASTDumper.cpp7
-rw-r--r--clang/lib/AST/TextNodeDumper.cpp11
-rw-r--r--clang/test/AST/ast-dump-undeserialized.cpp3
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>
OpenPOWER on IntegriCloud