[all-commits] [llvm/llvm-project] f9500c: [SyntaxTree] Expand support for `NestedNameSpecifier`

Eduardo Caldas via All-commits all-commits at lists.llvm.org
Mon Aug 10 08:47:44 PDT 2020


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

  Changed paths:
    M clang/include/clang/AST/NestedNameSpecifier.h
    M clang/lib/Tooling/Syntax/BuildTree.cpp
    M clang/unittests/Tooling/Syntax/TreeTest.cpp

  Log Message:
  -----------
  [SyntaxTree] Expand support for `NestedNameSpecifier`

Summary:
We want NestedNameSpecifier syntax nodes to be generally supported, not
only for `DeclRefExpr` and `DependentScopedDeclRefExpr`.

To achieve this we:
* Use the `RecursiveASTVisitor`'s API to traverse
`NestedNameSpecifierLoc`s and automatically create its syntax nodes
* Add links from the `NestedNameSpecifierLoc`s to their syntax nodes.

In this way, from any semantic construct that has a `NestedNameSpecifier`,
we implicitly generate its syntax node via RAV and we can easily access
this syntax node via the links we added.




More information about the All-commits mailing list