[all-commits] [llvm/llvm-project] c655d8: [SyntaxTree] Extend the syntax tree dump to also c...

Eduardo Caldas via All-commits all-commits at lists.llvm.org
Mon Aug 24 23:39:34 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: c655d8081570336dda109502ed1e7a2eff1b26e2
      https://github.com/llvm/llvm-project/commit/c655d8081570336dda109502ed1e7a2eff1b26e2
  Author: Eduardo Caldas <ecaldas at google.com>
  Date:   2020-08-25 (Tue, 25 Aug 2020)

  Changed paths:
    M clang/include/clang/Tooling/Syntax/Tree.h
    M clang/lib/Tooling/Syntax/BuildTree.cpp
    M clang/lib/Tooling/Syntax/Tree.cpp
    M clang/unittests/Tooling/Syntax/TreeTestBase.cpp

  Log Message:
  -----------
  [SyntaxTree] Extend the syntax tree dump to also cover `NodeRole`

We should see `NodeRole` information in the dump because that exposes how the
accessors will behave.

Functional changes in the dump:
* Surround Leaf tokens with `'`
* Append `Node` dumps with `NodeRole` information, except for unknown roles
* Append marks to `Node` dumps, instead of prepending

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
`dumpLeaf(llvm::raw_ostream, syntax::Leaf *, const SourceManager&)`
* `dumpTree` acted on a Node, rename to `dumpNode`

Differential Revision: https://reviews.llvm.org/D85330


  Commit: 02a9f8a27b7f22e4a499c5511142bd2650defad1
      https://github.com/llvm/llvm-project/commit/02a9f8a27b7f22e4a499c5511142bd2650defad1
  Author: Eduardo Caldas <ecaldas at google.com>
  Date:   2020-08-25 (Tue, 25 Aug 2020)

  Changed paths:
    M clang/unittests/Tooling/Syntax/BuildTreeTest.cpp

  Log Message:
  -----------
  [SyntaxTree] Update `Statement` tests to dump `NodeRole`


  Commit: 6118ce79a3d3832c8bcbd985fbd2bf0bee4ea8a2
      https://github.com/llvm/llvm-project/commit/6118ce79a3d3832c8bcbd985fbd2bf0bee4ea8a2
  Author: Eduardo Caldas <ecaldas at google.com>
  Date:   2020-08-25 (Tue, 25 Aug 2020)

  Changed paths:
    M clang/unittests/Tooling/Syntax/BuildTreeTest.cpp

  Log Message:
  -----------
  [SyntaxTree] Update `Expression` tests to dump `NodeRole`


  Commit: 5c11c08d86f3ae45ec3b2b2766c48a3dc572d05e
      https://github.com/llvm/llvm-project/commit/5c11c08d86f3ae45ec3b2b2766c48a3dc572d05e
  Author: Eduardo Caldas <ecaldas at google.com>
  Date:   2020-08-25 (Tue, 25 Aug 2020)

  Changed paths:
    M clang/unittests/Tooling/Syntax/BuildTreeTest.cpp

  Log Message:
  -----------
  [SyntaxTree] Update `Declaration` tests to dump `NodeRole`


  Commit: be2bc7d4cef2edd66c7fb74b70adf62fc68754db
      https://github.com/llvm/llvm-project/commit/be2bc7d4cef2edd66c7fb74b70adf62fc68754db
  Author: Eduardo Caldas <ecaldas at google.com>
  Date:   2020-08-25 (Tue, 25 Aug 2020)

  Changed paths:
    M clang/unittests/Tooling/Syntax/BuildTreeTest.cpp

  Log Message:
  -----------
  [SyntaxTree] Update `Modifiable` tests to dump `NodeRole` and `unmodifiable` tag


Compare: https://github.com/llvm/llvm-project/compare/2501e911a5a1...be2bc7d4cef2


More information about the All-commits mailing list