[all-commits] [llvm/llvm-project] ac37af: [SyntaxTree] Unbox operators into tokens for nodes...

Eduardo Caldas via All-commits all-commits at lists.llvm.org
Wed Aug 12 01:14:33 PDT 2020


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

  Changed paths:
    M clang/lib/Tooling/Syntax/BuildTree.cpp
    M clang/unittests/Tooling/Syntax/TreeTest.cpp

  Log Message:
  -----------
  [SyntaxTree] Unbox operators into tokens for nodes generated from `CXXOperatorCallExpr`

For an user define `<`, `x < y` would yield the syntax tree:
```
BinaryOperatorExpression
|-IdExpression
| `-UnqualifiedId
|   `-x
|-IdExpression
| `-UnqualifiedId
|   `-<
`-IdExpression
  `-UnqualifiedId
    `-y
```
But there is no syntatic difference at call site between call site or
built-in `<`. As such they should generate the same syntax tree, namely:
```
BinaryOperatorExpression
|-IdExpression
| `-UnqualifiedId
|   `-x
|-<
`-IdExpression
  `-UnqualifiedId
    `-y
```

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




More information about the All-commits mailing list