Index: lib/Frontend/ASTConsumers.cpp =================================================================== --- lib/Frontend/ASTConsumers.cpp +++ lib/Frontend/ASTConsumers.cpp @@ -418,117 +418,27 @@ Out << " "; Decl::Kind DK = I->getKind(); + + if (auto *DC = dyn_cast(I)) { + PrintDeclContext(DC, Indentation + 1); + continue; + } + switch (DK) { - case Decl::Namespace: - case Decl::Enum: - case Decl::Record: - case Decl::CXXRecord: - case Decl::ObjCMethod: - case Decl::ObjCInterface: - case Decl::ObjCCategory: - case Decl::ObjCProtocol: - case Decl::ObjCImplementation: - case Decl::ObjCCategoryImpl: - case Decl::LinkageSpec: - case Decl::Block: - case Decl::Function: - case Decl::CXXMethod: - case Decl::CXXConstructor: - case Decl::CXXDestructor: - case Decl::CXXConversion: - case Decl::ClassTemplateSpecialization: - case Decl::ClassTemplatePartialSpecialization: { - DeclContext* DC = cast(I); - PrintDeclContext(DC, Indentation+2); - break; - } - case Decl::IndirectField: - Out << " " << *cast(I) << '\n'; - break; - case Decl::Label: - Out << "