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
This commit is contained in:
Stephen Kelly 2019-01-19 09:05:55 +00:00
parent 2946cd7010
commit 25f18bfd4f
3 changed files with 12 additions and 9 deletions

View File

@ -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) {

View File

@ -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) {

View File

@ -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>