[PATCH] D90221: Include attribute details when dumping AST in JSON

Lev Aronsky via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 28 02:16:28 PDT 2020


aronsky added a comment.

In D90221#2357060 <https://reviews.llvm.org/D90221#2357060>, @aaron.ballman wrote:

> In D90221#2356110 <https://reviews.llvm.org/D90221#2356110>, @aronsky wrote:
>
>> In D90221#2356062 <https://reviews.llvm.org/D90221#2356062>, @lebedev.ri wrote:
>>
>>> Are there tests missing?
>>
>> Quite possible. I followed the trail of the existing functions to figure out the difference between JSON and textual dumping, and tried replicating everything in a manner similar to the existing code. I haven't run into any tests, but that's probably because I wasn't looking for those. I'll add the appropriate tests ASAP.
>
> FWIW, the tests for dumping JSON live in `clang\test\AST` and typically have a `-json` extension on them. There is a helper script named `gen_ast_dump_json_test.py` that can be used to generate the expected output from the test.

Thanks, I'll take a look at the Python script, that'll be helpful!

Those functions do look out of place, but they are actually called via polymorphism (I wish I could point to the exact location - it wasn't easy figuring that out in the first place, and the actual work was done about a month ago, I just got to publishing the PR yesterday). The code that calls these functions is emitted at `writeDump` (in `clang/utils/TableGen/ClangAttrEmitter.cpp`) - which, in turn, is called by `EmitClangAttrJSONNodeDump` and `EmitClangAttrTextNodeDump` in the same file.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D90221/new/

https://reviews.llvm.org/D90221



More information about the cfe-commits mailing list