[PATCH] D69564: Include the mangled name in -ast-dump=json

Alexander Richardson via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 29 06:55:08 PDT 2019


arichardson created this revision.
arichardson added a reviewer: aaron.ballman.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

I am planning to use this feature to make update_cc_checks.py less fragile
by obtaining the mangled names directly from -ast-dump=json.

This is a series of five commits (but since they are all small I've squashed them into one review):

---

Add a --update flag to gen_ast_dump_json_test.py

This will allow updating the JSON tests for new format changes. Instead of
simply appending the JSON to the input file, the script will now make a
copy of the input file up to the "CHECK lines have been autogenerated"
disclaimer and then append the new JSON.

---

Parse RUN: line for gen_ast_dump_json_test.py with --update

---

Infer --filters flags when using gen_ast_dump_json_test.py --update

---

Skip manual tests when using gen_ast_dump_json_tests.py --update

---

Include the mangled name in -ast-dump=json

I am planning to use this feature to make update_cc_checks.py less fragile
by obtaining the mangled names directly from -ast-dump=json. Currently,
it uses c-index-test which ignores the -triple=, etc. arguments that are
in the RUN: line and therefore does not generate checks for some targets.

The AST dump tests were updated using the following script:

  for src in $LLVM_SRC/clang/test/AST/ast-dump-*-json.*; do
     if ! python $LLVM_SRC/clang/test/AST/gen_ast_dump_json_test.py --clang $LLVM_BUILD/bin/clang --update --source $src; then
         echo "FAILED TO UPDATE $src";
         break;
     fi;
  done


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D69564

Files:
  clang/include/clang/AST/JSONNodeDumper.h
  clang/lib/AST/JSONNodeDumper.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-expr-json.c
  clang/test/AST/ast-dump-expr-json.cpp
  clang/test/AST/ast-dump-expr-json.m
  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-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/gen_ast_dump_json_test.py

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D69564.226893.patch
Type: text/x-patch
Size: 464433 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20191029/85589f51/attachment-0001.bin>


More information about the cfe-commits mailing list