[PATCH] D85330: [SyntaxTree] Extend the syntax tree dump

Eduardo Caldas via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 5 10:31:03 PDT 2020


eduucaldas created this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
eduucaldas requested review of this revision.

Functional changes in the dump:

- Surround Leaf tokens with `'`
- Append `Node` dumps  with `NodeRole` information, except for unknown roles

Non-functional changes:

- `::dumpTokens(llvm::raw_ostream, ArrayRef<syntax::Token>, const SourceManager &SM)` always received as parameter a `syntax::Token *` pointing to `Leaf::token()`. Changed the function to `strOfLeaf(syntax::Leaf *, const SourceManager&)`
- `dumpTree` acted on a Node, rename to `dumpNode`

TODO:
Adapt all the tree dumps in `TreeTest.cpp` to this new format.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D85330

Files:
  clang/include/clang/Tooling/Syntax/Tree.h
  clang/lib/Tooling/Syntax/BuildTree.cpp
  clang/lib/Tooling/Syntax/Tree.cpp
  clang/unittests/Tooling/Syntax/TreeTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D85330.283296.patch
Type: text/x-patch
Size: 5299 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200805/7e05bbeb/attachment-0001.bin>


More information about the cfe-commits mailing list