History log of /llvm-project/clang/lib/Tooling/Syntax/BuildTree.cpp (Results 1 – 25 of 84)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: llvmorg-18.1.8, llvmorg-18.1.7, llvmorg-18.1.6
# 12028373 14-May-2024 Krystian Stasiowski <sdkrystian@gmail.com>

Reapply "[Clang] Unify interface for accessing template arguments as written for class/variable template specializations (#81642)" (#91393)

Reapplies #81642, fixing the crash which occurs when runni

Reapply "[Clang] Unify interface for accessing template arguments as written for class/variable template specializations (#81642)" (#91393)

Reapplies #81642, fixing the crash which occurs when running the lldb test suite.

show more ...


# c6855ab2 07-May-2024 Adrian Prantl <aprantl@apple.com>

Revert "[Clang] Unify interface for accessing template arguments as written for class/variable template specializations (#81642)"

This reverts commit 7115ed0fff027b65fa76fdfae215ed1382ed1473.

This

Revert "[Clang] Unify interface for accessing template arguments as written for class/variable template specializations (#81642)"

This reverts commit 7115ed0fff027b65fa76fdfae215ed1382ed1473.

This commit broke several LLDB tests.

https://green.lab.llvm.org/job/llvm.org/view/LLDB/job/as-lldb-cmake/3480/

show more ...


# 7115ed0f 07-May-2024 Krystian Stasiowski <sdkrystian@gmail.com>

[Clang] Unify interface for accessing template arguments as written for class/variable template specializations (#81642)

Our current method of storing the template arguments as written for
`(Class/

[Clang] Unify interface for accessing template arguments as written for class/variable template specializations (#81642)

Our current method of storing the template arguments as written for
`(Class/Var)Template(Partial)SpecializationDecl` suffers from a number
of flaws:
- We use `TypeSourceInfo` to store `TemplateArgumentLocs` for class
template/variable template partial/explicit specializations. For
variable template specializations, this is a rather unintuitive hack (as
we store a non-type specialization as a type). Moreover, we don't ever
*need* the type as written -- in almost all cases, we only want the
template arguments (e.g. in tooling use-cases).
- The template arguments as written are stored in a number of redundant
data members. For example, `(Class/Var)TemplatePartialSpecialization`
have their own `ArgsAsWritten` member that stores an
`ASTTemplateArgumentListInfo` (the template arguments).
`VarTemplateSpecializationDecl` has yet _another_ redundant member
"`TemplateArgsInfo`" that also stores an `ASTTemplateArgumentListInfo`.

This patch eliminates all
`(Class/Var)Template(Partial)SpecializationDecl` members which store the
template arguments as written, and turns the `ExplicitInfo` member into
a `llvm::PointerUnion<const ASTTemplateArgumentListInfo*,
ExplicitInstantiationInfo*>` (to avoid unnecessary allocations when the
declaration isn't an explicit instantiation). The template arguments as
written are now accessed via `getTemplateArgsWritten` in all cases.

The "most breaking" change is to AST Matchers, insofar that `hasTypeLoc`
will no longer match class template specializations (since they no
longer store the type as written).

show more ...


Revision tags: llvmorg-18.1.5, llvmorg-18.1.4, llvmorg-18.1.3, llvmorg-18.1.2, llvmorg-18.1.1, llvmorg-18.1.0, llvmorg-18.1.0-rc4, llvmorg-18.1.0-rc3, llvmorg-18.1.0-rc2, llvmorg-18.1.0-rc1, llvmorg-19-init, llvmorg-17.0.6, llvmorg-17.0.5, llvmorg-17.0.4, llvmorg-17.0.3, llvmorg-17.0.2, llvmorg-17.0.1, llvmorg-17.0.0, llvmorg-17.0.0-rc4, llvmorg-17.0.0-rc3, llvmorg-17.0.0-rc2, llvmorg-17.0.0-rc1, llvmorg-18-init, llvmorg-16.0.6, llvmorg-16.0.5, llvmorg-16.0.4, llvmorg-16.0.3, llvmorg-16.0.2, llvmorg-16.0.1, llvmorg-16.0.0, llvmorg-16.0.0-rc4, llvmorg-16.0.0-rc3, llvmorg-16.0.0-rc2, llvmorg-16.0.0-rc1, llvmorg-17-init, llvmorg-15.0.7
# a3c248db 06-Jan-2023 serge-sans-paille <sguelton@mozilla.com>

Move from llvm::makeArrayRef to ArrayRef deduction guides - clang/ part

This is a follow-up to https://reviews.llvm.org/D140896, split into
several parts as it touches a lot of files.

Differential

Move from llvm::makeArrayRef to ArrayRef deduction guides - clang/ part

This is a follow-up to https://reviews.llvm.org/D140896, split into
several parts as it touches a lot of files.

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

show more ...


Revision tags: llvmorg-15.0.6, llvmorg-15.0.5, llvmorg-15.0.4, llvmorg-15.0.3, working, llvmorg-15.0.2, llvmorg-15.0.1, llvmorg-15.0.0, llvmorg-15.0.0-rc3, llvmorg-15.0.0-rc2, llvmorg-15.0.0-rc1, llvmorg-16-init
# 263dcf45 07-Jul-2022 Haojian Wu <hokein.wu@gmail.com>

[syntax] Introduce a TokenManager interface.

TokenManager defines Token interfaces for the clang syntax-tree. This is the level
of abstraction that the syntax-tree should use to operate on Tokens.

[syntax] Introduce a TokenManager interface.

TokenManager defines Token interfaces for the clang syntax-tree. This is the level
of abstraction that the syntax-tree should use to operate on Tokens.

It decouples the syntax-tree from a particular token implementation (TokenBuffer
previously). This enables us to use a different underlying token implementation
for the syntax Leaf node -- in clang pseudoparser, we want to produce a
syntax-tree with its own pseudo::Token rather than syntax::Token.

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

show more ...


Revision tags: llvmorg-14.0.6
# 0916d96d 21-Jun-2022 Kazu Hirata <kazu@google.com>

Don't use Optional::hasValue (NFC)


Revision tags: llvmorg-14.0.5, llvmorg-14.0.4, llvmorg-14.0.3, llvmorg-14.0.2, llvmorg-14.0.1, llvmorg-14.0.0, llvmorg-14.0.0-rc4, llvmorg-14.0.0-rc3, llvmorg-14.0.0-rc2, llvmorg-14.0.0-rc1, llvmorg-15-init, llvmorg-13.0.1, llvmorg-13.0.1-rc3, llvmorg-13.0.1-rc2, llvmorg-13.0.1-rc1
# 16ceb44e 25-Oct-2021 Kazu Hirata <kazu@google.com>

[clang] Use llvm::{count,count_if,find_if,all_of,none_of} (NFC)


Revision tags: llvmorg-13.0.0, llvmorg-13.0.0-rc4, llvmorg-13.0.0-rc3, llvmorg-13.0.0-rc2, llvmorg-13.0.0-rc1, llvmorg-14-init, llvmorg-12.0.1, llvmorg-12.0.1-rc4, llvmorg-12.0.1-rc3, llvmorg-12.0.1-rc2, llvmorg-12.0.1-rc1, llvmorg-12.0.0, llvmorg-12.0.0-rc5, llvmorg-12.0.0-rc4, llvmorg-12.0.0-rc3, llvmorg-12.0.0-rc2
# 780ead41 18-Feb-2021 Haojian Wu <hokein.wu@gmail.com>

[Syntax] No crash on OpaqueValueExpr.

OpaqueValueExpr doesn't correspond to the concrete syntax, it has
invalid source location, ignore them.

Reviewed By: kbobyrev

Differential Revision: https://r

[Syntax] No crash on OpaqueValueExpr.

OpaqueValueExpr doesn't correspond to the concrete syntax, it has
invalid source location, ignore them.

Reviewed By: kbobyrev

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

show more ...


# e159a3ce 08-Feb-2021 Haojian Wu <hokein.wu@gmail.com>

[Syntax] Remove a strict valid source location assertion for TypeLoc.

The EndLoc of a type loc can be invalid for broken code.

Also extend the existing test to support error code with `error-ok`
an

[Syntax] Remove a strict valid source location assertion for TypeLoc.

The EndLoc of a type loc can be invalid for broken code.

Also extend the existing test to support error code with `error-ok`
annotation.

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

show more ...


Revision tags: llvmorg-11.1.0, llvmorg-11.1.0-rc3
# 6c1a2330 01-Feb-2021 Haojian Wu <hokein.wu@gmail.com>

[Syntax] Support condition for IfStmt.

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


Revision tags: llvmorg-12.0.0-rc1, llvmorg-13-init, llvmorg-11.1.0-rc2, llvmorg-11.1.0-rc1, llvmorg-11.0.1, llvmorg-11.0.1-rc2, llvmorg-11.0.1-rc1
# 142c6f82 09-Nov-2020 Kirill Bobyrev <kbobyrev@google.com>

[clang] Simplify buildSyntaxTree API

Follow-up on https://reviews.llvm.org/D88553#inline-837013

Reviewed By: sammccall

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


# 23657d9c 27-Oct-2020 Eduardo Caldas <ecaldas@google.com>

[SyntaxTree] Add reverse links to syntax Nodes.

Rationale:
Children of a syntax tree had forward links only, because there was no
need for reverse links.

This need appeared when we started mutating

[SyntaxTree] Add reverse links to syntax Nodes.

Rationale:
Children of a syntax tree had forward links only, because there was no
need for reverse links.

This need appeared when we started mutating the syntax tree.
On a forward list, to remove a target node in O(1) we need a pointer to the node before the target. If we don't have this "before" pointer, we have to find it, and that requires O(n).
So in order to remove a syntax node from a tree, we would similarly need to find the node before to then remove. This is both not ergonomic nor does it have a good complexity.

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

show more ...


# 78194118 20-Oct-2020 Mikhail Maltsev <mikhail.maltsev@arm.com>

[clang] Use SourceLocation as key in hash maps, NFCI

The patch adjusts the existing `llvm::DenseMap<unsigned, T>` and
`llvm::DenseSet<unsigned>` objects that store source locations, so
that they use

[clang] Use SourceLocation as key in hash maps, NFCI

The patch adjusts the existing `llvm::DenseMap<unsigned, T>` and
`llvm::DenseSet<unsigned>` objects that store source locations, so
that they use `SourceLocation` directly instead of `unsigned`.

This patch relies on the `DenseMapInfo` trait added in D89719.

It also replaces the construction of `SourceLocation` objects from
the constants -1 and -2 with calls to the trait's methods `getEmptyKey`
and `getTombstoneKey` where appropriate.

Reviewed By: dexonsmith

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

show more ...


Revision tags: llvmorg-11.0.0, llvmorg-11.0.0-rc6, llvmorg-11.0.0-rc5, llvmorg-11.0.0-rc4
# 5011d431 28-Sep-2020 Eduardo Caldas <ecaldas@google.com>

Migrate Declarators to use the List API

After this change all nodes that have a delimited-list are using the
`List` API.

Implementation details:
Let's look at a declaration with multiple declarator

Migrate Declarators to use the List API

After this change all nodes that have a delimited-list are using the
`List` API.

Implementation details:
Let's look at a declaration with multiple declarators:
`int a, b;`
To generate a declarator list node we need to have the range of
declarators: `a, b`:
However, the `ClangAST` actually stores them as separate declarations:
`int a ;`
`int b;`
We solve that by appropriately marking the declarators on each separate
declaration in the `ClangAST` and then for the final declarator `int
b`, shrinking its range to fit to the already marked declarators.

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

show more ...


Revision tags: llvmorg-11.0.0-rc3
# 87f0b51d 21-Sep-2020 Eduardo Caldas <ecaldas@google.com>

[SyntaxTree][NFC] follow naming convention + remove auto on empty vector declaration

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


# e10df779 11-Sep-2020 Dmitri Gribenko <gribozavr@gmail.com>

Fix clang Wrange-loop-analysis in BuildTree.cpp

Building on Mac OS with clang 12:

```
jhemphill@jhemphill-mbp build % clang --version
Apple clang version 12.0.0 (clang-1200.0.26.2)
Target: x86_64-a

Fix clang Wrange-loop-analysis in BuildTree.cpp

Building on Mac OS with clang 12:

```
jhemphill@jhemphill-mbp build % clang --version
Apple clang version 12.0.0 (clang-1200.0.26.2)
Target: x86_64-apple-darwin19.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
```

yields one warning:

```
/Users/jhemphill/oss/llvm-project/clang/lib/Tooling/Syntax/BuildTree.cpp:1126:22: warning: loop variable 'Arg' is always a copy because the range of type 'llvm::iterator_range<clang::Stmt::CastIterator<clang::Expr, clang::Expr *, clang::Stmt *> >' does not return a reference [-Wrange-loop-analysis]
for (const auto &Arg : Args) {
^
/Users/jhemphill/oss/llvm-project/clang/lib/Tooling/Syntax/BuildTree.cpp:1126:10: note: use non-reference type 'clang::Expr *'
for (const auto &Arg : Args) {
```

It appears that `Arg` is an `Expr*`, passed by value rather than by const reference.

Reviewed By: eduucaldas, gribozavr2

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

show more ...


# 238ae4ee 11-Sep-2020 Eduardo Caldas <ecaldas@google.com>

[SyntaxTree] Add const qualifiers, from [llvm-qualified-auto]

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


# 4c14ee61 11-Sep-2020 Eduardo Caldas <ecaldas@google.com>

[SyntaxTree] Rename functions to start with verb

According to LLVM coding standards:
https://llvm.org/docs/CodingStandards.html#name-types-functions-variables-and-enumerators-properly

Differential

[SyntaxTree] Rename functions to start with verb

According to LLVM coding standards:
https://llvm.org/docs/CodingStandards.html#name-types-functions-variables-and-enumerators-properly

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

show more ...


# f5087d5c 07-Sep-2020 Eduardo Caldas <ecaldas@google.com>

[SyntaxTree] Fix crash on functions with default arguments.

* Do not visit `CXXDefaultArgExpr`
* To build `CallArguments` nodes, just go through non-default arguments

Differential Revision: https:/

[SyntaxTree] Fix crash on functions with default arguments.

* Do not visit `CXXDefaultArgExpr`
* To build `CallArguments` nodes, just go through non-default arguments

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

show more ...


# 134455a0 07-Sep-2020 Eduardo Caldas <ecaldas@google.com>

[SyntaxTree] Ignore implicit `CXXFunctionalCastExpr` wrapping constructor

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


# 46f4439d 27-Aug-2020 Eduardo Caldas <ecaldas@google.com>

[SyntaxTree] Ignore implicit leaf `CXXConstructExpr`

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


# 2325d6b4 27-Aug-2020 Eduardo Caldas <ecaldas@google.com>

[SyntaxTree] Ignore implicit non-leaf `CXXConstructExpr`

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


# a1461953 28-Aug-2020 Eduardo Caldas <ecaldas@google.com>

[SyntaxTree] Add coverage for declarators and init-declarators


# 38bc0060 27-Aug-2020 Eduardo Caldas <ecaldas@google.com>

[SyntaxTree][NFC] Refactor function templates into functions taking base class

The refactored functions were
* `isReponsibleForCreatingDeclaration`
* `getQualifiedNameStart`

Differential Revision:

[SyntaxTree][NFC] Refactor function templates into functions taking base class

The refactored functions were
* `isReponsibleForCreatingDeclaration`
* `getQualifiedNameStart`

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

show more ...


# ac87a0b5 27-Aug-2020 Eduardo Caldas <ecaldas@google.com>

[SyntaxTree][NFC][Style] Functions start with lowercase

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


1234