D52529: Propose to delete -print-decl-contexts

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

D52529: Propose to delete -print-decl-contexts

David Blaikie via cfe-dev
clang++ -fsyntax-only -Xclang -print-decl-contexts a.cc
clang++ -fsyntax-only -Xclang -ast-dump a.cc

-print-decl-contexts (DeclContextPrinter) is a cc1 option that dumps
AST nodes in the following manner:

// lib/Frontend/ASTConsumers.cpp
    case Decl::Using:
      Out << "<using> " << *cast<UsingDecl>(I) << "\n";
    case Decl::UsingShadow:
      Out << "<using shadow> " << *cast<UsingShadowDecl>(I) << "\n";

It lacks handling of many AST nodes which will lead to llvm_unreachable() crash.

      Out << "DeclKind: " << DK << '"' << I << "\"\n";
      llvm_unreachable("decl unhandled");

I tried handling other cases with clang/AST/DeclNodes.inc but then
realized that deleting it might be better as it is a rarely used
feature (not actively maintained and easy to crash). Its functionality
is mostly covered by -ast-dump (which is a bit verbose)
-ast-dump-lookups -ast-list

I have sent out D52529 for deleting -print-decl-contexts and will commit
it if nobody opposes.

cfe-dev mailing list
[hidden email]