[PATCH] D100762: [clang][cli] Extract AST dump format into extra option

Jan Svoboda via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 19 07:13:48 PDT 2021


jansvoboda11 created this revision.
jansvoboda11 added reviewers: Bigcheese, dexonsmith, arichardson.
Herald added subscribers: dang, usaxena95, kadircet, arphaman.
jansvoboda11 requested review of this revision.
Herald added projects: clang, LLVM, clang-tools-extra.
Herald added subscribers: llvm-commits, cfe-commits.

When dumping AST, the JSON format can be requested in two ways: `-ast-dump=json` and `-ast-dump-all=json`. Both of those command line options control `FrontendOptions::ASTDumpFormat`.

This patch deduplicates the options by introducing `-ast-dump-format`, removes the `_EQ` variants of `-ast-dump` and `-ast-dump-all`, and simplifies option parsing/generation.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D100762

Files:
  clang-tools-extra/clangd/DumpAST.h
  clang/include/clang/Driver/Options.td
  clang/lib/Frontend/CompilerInvocation.cpp
  clang/test/AST/ast-dump-comment-json.cpp
  clang/test/AST/ast-dump-decl-context-json.cpp
  clang/test/AST/ast-dump-decl-json.c
  clang/test/AST/ast-dump-decl-json.m
  clang/test/AST/ast-dump-enum-json.cpp
  clang/test/AST/ast-dump-expr-json.c
  clang/test/AST/ast-dump-expr-json.cpp
  clang/test/AST/ast-dump-expr-json.m
  clang/test/AST/ast-dump-file-line-json.c
  clang/test/AST/ast-dump-funcs-json.cpp
  clang/test/AST/ast-dump-if-json.cpp
  clang/test/AST/ast-dump-macro-json.c
  clang/test/AST/ast-dump-namespace-json.cpp
  clang/test/AST/ast-dump-objc-arc-json.m
  clang/test/AST/ast-dump-record-definition-data-json.cpp
  clang/test/AST/ast-dump-records-json.cpp
  clang/test/AST/ast-dump-stmt-json.c
  clang/test/AST/ast-dump-stmt-json.cpp
  clang/test/AST/ast-dump-stmt-json.m
  clang/test/AST/ast-dump-template-decls-json.cpp
  clang/test/AST/ast-dump-temporaries-json.cpp
  clang/test/AST/ast-dump-types-errors-json.cpp
  clang/test/AST/ast-dump-types-json.cpp
  clang/test/AST/gen_ast_dump_json_test.py
  clang/test/AST/multistep-explicit-cast-json.c
  clang/test/AST/multistep-explicit-cast-json.cpp
  llvm/utils/update_cc_test_checks.py



More information about the cfe-commits mailing list