[PATCH] D87249: [SyntaxTree] Fix crash on functions with default arguments.

2020-09-07 Thread Eduardo Caldas via Phabricator via cfe-commits
eduucaldas updated this revision to Diff 290410. eduucaldas added a comment. Add tests for constructor calls Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D87249/new/ https://reviews.llvm.org/D87249 Files: clang/lib/Tooling/Syntax/BuildTree.cpp

[PATCH] D86699: [SyntaxTree] Ignore implicit non-leaf `CXXConstructExpr`

2020-09-08 Thread Eduardo Caldas via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG2325d6b42f09: [SyntaxTree] Ignore implicit non-leaf `CXXConstructExpr` (authored by eduucaldas). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D86699/new/ ht

[PATCH] D86700: [SyntaxTree] Ignore leaf implicit `CXXConstructExpr`

2020-09-08 Thread Eduardo Caldas via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG46f4439dc9bf: [SyntaxTree] Ignore implicit leaf `CXXConstructExpr` (authored by eduucaldas). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D86700/new/ https:

[PATCH] D87229: [SyntaxTree] Ignore implicit `CXXFunctionalCastExpr` wrapping constructor

2020-09-08 Thread Eduardo Caldas via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG134455a07c1f: [SyntaxTree] Ignore implicit `CXXFunctionalCastExpr` wrapping constructor (authored by eduucaldas). Repository: rG LLVM Github Monor

[PATCH] D87249: [SyntaxTree] Fix crash on functions with default arguments.

2020-09-08 Thread Eduardo Caldas via Phabricator via cfe-commits
eduucaldas updated this revision to Diff 290439. eduucaldas added a comment. Test init declarator with default arguments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D87249/new/ https://reviews.llvm.org/D87249 Files: clang/lib/Tooling/Syntax/Bui

[PATCH] D87249: [SyntaxTree] Fix crash on functions with default arguments.

2020-09-08 Thread Eduardo Caldas via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGf5087d5c7248: [SyntaxTree] Fix crash on functions with default arguments. (authored by eduucaldas). Repository: rG LLVM Github Monorepo CHANGES S

[PATCH] D87278: [Ignore Expressions] Fix performance regression by inlining `Ignore*SingleStep`

2020-09-08 Thread Eduardo Caldas via Phabricator via cfe-commits
eduucaldas created this revision. eduucaldas added a reviewer: gribozavr2. Herald added subscribers: cfe-commits, mgorny. Herald added a project: clang. eduucaldas requested review of this revision. We also add a `const` versions of `IgnoreExprNodes` Repository: rG LLVM Github Monorepo https:

[PATCH] D87278: [Ignore Expressions] Fix performance regression by inlining `Ignore*SingleStep`

2020-09-09 Thread Eduardo Caldas via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGc0e5e3fbfa50: [Ignore Expressions] Fix performance regression by inlining `Ignore*SingleStep` (authored by eduucaldas). Repository: rG LLVM Github

[PATCH] D87374: [SyntaxTree] Specialize `TreeTestBase` for `BuildTreeTest` and `MutationsTest`

2020-09-09 Thread Eduardo Caldas via Phabricator via cfe-commits
eduucaldas created this revision. eduucaldas added a reviewer: gribozavr2. Herald added a project: clang. Herald added a subscriber: cfe-commits. eduucaldas requested review of this revision. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D87374 Files: clang/unittests/Tooling/S

[PATCH] D87374: [SyntaxTree] Specialize `TreeTestBase` for `BuildTreeTest` and `MutationsTest`

2020-09-09 Thread Eduardo Caldas via Phabricator via cfe-commits
eduucaldas added inline comments. Comment at: clang/unittests/Tooling/Syntax/MutationsTest.cpp:75-85 +INSTANTIATE_TEST_CASE_P(SyntaxTreeTests, SyntaxTreeTest, +::testing::ValuesIn(allTestClangConfigs()), ); + TEST_P(SyntaxTreeTest, SynthesizedNodes) {

[PATCH] D87374: [SyntaxTree] Specialize `TreeTestBase` for `BuildTreeTest` and `MutationsTest`

2020-09-09 Thread Eduardo Caldas via Phabricator via cfe-commits
eduucaldas updated this revision to Diff 290880. eduucaldas added a comment. Herald added a subscriber: mgorny. - [SyntaxTree] Extract `SynthesisTest` from `MutationsTest` Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D87374/new/ https://reviews.llv

[PATCH] D87374: [SyntaxTree] Specialize `TreeTestBase` for `BuildTreeTest` and `MutationsTest`

2020-09-10 Thread Eduardo Caldas via Phabricator via cfe-commits
eduucaldas updated this revision to Diff 290951. eduucaldas marked 3 inline comments as done. eduucaldas added a comment. - `MutationsTest`: Split tests and infrastructure - `SynthesisTest`: Split tests Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D

[PATCH] D87374: [SyntaxTree] Specialize `TreeTestBase` for `BuildTreeTest` and `MutationsTest`

2020-09-10 Thread Eduardo Caldas via Phabricator via cfe-commits
eduucaldas updated this revision to Diff 290952. eduucaldas added a comment. nit Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D87374/new/ https://reviews.

[PATCH] D87374: [SyntaxTree] Specialize `TreeTestBase` for `BuildTreeTest` and `MutationsTest`

2020-09-10 Thread Eduardo Caldas via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGc01d28dc51bd: [SyntaxTree] Specialize `TreeTestBase` for `BuildTreeTest`, `MutationsTest` and… (authored by eduucaldas). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.

[PATCH] D90543: [Syntax] Start to move trivial Node class definitions to TableGen. NFC

2020-11-04 Thread Eduardo Caldas via Phabricator via cfe-commits
eduucaldas added a comment. > Compared to Dmitri's prototype, Nodes.td looks more like a class hierarchy and > less like a grammar. (E.g. variants list the Alternatives parent rather than > vice versa). > e.g. we may introduce abstract bases like "loop" that the grammar doesn't > care about in

[PATCH] D90240: [SyntaxTree] Add reverse links to syntax Nodes.

2020-11-04 Thread Eduardo Caldas via Phabricator via cfe-commits
eduucaldas added a comment. As we discussed offline we will probably not provide `replaceChildRange` in the public mutations API anymore. As a result I don't think we should be chaining changes related to `replaceChildRange` in this patch, and thus it should be ready to go. Repository: rG L

[PATCH] D90240: [SyntaxTree] Add reverse links to syntax Nodes.

2020-11-04 Thread Eduardo Caldas via Phabricator via cfe-commits
eduucaldas updated this revision to Diff 302879. eduucaldas added a comment. Rebase Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D90240/new/ https://reviews.llvm.org/D90240 Files: clang/include/clang/Tooling/Syntax/Tree.h clang/lib/Tooling/Syn

[PATCH] D90240: [SyntaxTree] Add reverse links to syntax Nodes.

2020-11-05 Thread Eduardo Caldas via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG23657d9cc332: [SyntaxTree] Add reverse links to syntax Nodes. (authored by eduucaldas). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST AC

[PATCH] D88403: Migrate Declarators to use the List API

2020-09-29 Thread Eduardo Caldas via Phabricator via cfe-commits
eduucaldas marked 3 inline comments as done. eduucaldas added inline comments. Comment at: clang/unittests/Tooling/Syntax/BuildTreeTest.cpp:2932 |-'void' - |-SimpleDeclarator Declarator - | |-'foo' - | `-ParametersAndQualifiers - | |-'(' OpenParen - | `-')' CloseParen

[PATCH] D88403: Migrate Declarators to use the List API

2020-09-29 Thread Eduardo Caldas via Phabricator via cfe-commits
eduucaldas updated this revision to Diff 294905. eduucaldas marked an inline comment as done. eduucaldas added a comment. Improve comment Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D88403/new/ https://reviews.llvm.org/D88403 Files: clang/inclu

[PATCH] D88403: Migrate Declarators to use the List API

2020-09-29 Thread Eduardo Caldas via Phabricator via cfe-commits
eduucaldas updated this revision to Diff 295053. eduucaldas added a comment. Update tests Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D88403/new/ https://reviews.llvm.org/D88403 Files: clang/include/clang/Tooling/Syntax/Nodes.h clang/lib/Tool

[PATCH] D88403: Migrate Declarators to use the List API

2020-10-01 Thread Eduardo Caldas via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG5011d43108d1: Migrate Declarators to use the List API (authored by eduucaldas). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D88403/new/ https://reviews.llv

[PATCH] D88106: [SyntaxTree] Provide iterator-like functions for Lists

2020-10-08 Thread Eduardo Caldas via Phabricator via cfe-commits
eduucaldas updated this revision to Diff 296994. eduucaldas added a comment. - [SyntaxTree] Provide iterator for `List` that iterates through `ElementAndDelimiter`s even for not well-defined lists. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D8810

[PATCH] D88106: [SyntaxTree] Provide iterator-like functions for Lists

2020-10-08 Thread Eduardo Caldas via Phabricator via cfe-commits
eduucaldas updated this revision to Diff 296996. eduucaldas added a comment. Better comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D88106/new/ https://reviews.llvm.org/D88106 Files: clang/include/clang/Tooling/Syntax/Tree.h clang/lib/To

[PATCH] D88106: [SyntaxTree] Provide iterator-like functions for Lists

2020-10-08 Thread Eduardo Caldas via Phabricator via cfe-commits
eduucaldas updated this revision to Diff 297001. eduucaldas added a comment. Reorganize methods to minimize diffs Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D88106/new/ https://reviews.llvm.org/D88106 Files: clang/include/clang/Tooling/Syntax/

[PATCH] D88106: [SyntaxTree] Provide iterator-like functions for Lists

2020-10-08 Thread Eduardo Caldas via Phabricator via cfe-commits
eduucaldas updated this revision to Diff 297006. eduucaldas added a comment. Replace `auto .. = std::vector();` with `std::vector ..;` Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D88106/new/ https://reviews.llvm.org/D88106 Files: clang/include/

[PATCH] D88106: [SyntaxTree] Provide iterator-like functions for Lists

2020-10-08 Thread Eduardo Caldas via Phabricator via cfe-commits
eduucaldas added a reviewer: gribozavr2. eduucaldas added a comment. This is quite low priority, compared to the other branches of work, but it was almost ready work, so I decided to polish it and send it to review now. Comment at: clang/include/clang/Tooling/Syntax/Tree.h:238

[PATCH] D89146: [SyntaxTree] Fix rtti for `Expression`.

2020-10-09 Thread Eduardo Caldas via Phabricator via cfe-commits
eduucaldas created this revision. eduucaldas added a reviewer: gribozavr2. Herald added a project: clang. Herald added a subscriber: cfe-commits. eduucaldas requested review of this revision. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D89146 Files: clang/include/clang/Tooli

[PATCH] D89147: [SyntaxTree] Improve the signature of `replaceChildRangeLowLevel`.

2020-10-09 Thread Eduardo Caldas via Phabricator via cfe-commits
eduucaldas created this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. eduucaldas requested review of this revision. Previously `replaceChildRangeLowLevel` took the new child range as a `Node* New`. `New` was expected to have siblings attached already, and thus i

[PATCH] D89148: [SyntaxTree] Artificial use of the Mutations API.

2020-10-09 Thread Eduardo Caldas via Phabricator via cfe-commits
eduucaldas created this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. eduucaldas requested review of this revision. Not intended for submission. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D89148 Files: clang/include/clang/Tooling/Syntax/

[PATCH] D89147: [SyntaxTree] Improve the signature of `replaceChildRangeLowLevel`.

2020-10-10 Thread Eduardo Caldas via Phabricator via cfe-commits
eduucaldas updated this revision to Diff 297389. eduucaldas added a comment. Add reachability assertions Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D89147/new/ https://reviews.llvm.org/D89147 Files: clang/include/clang/Tooling/Syntax/Tree.h

[PATCH] D89147: [SyntaxTree] Improve the signature of `replaceChildRangeLowLevel`.

2020-10-10 Thread Eduardo Caldas via Phabricator via cfe-commits
eduucaldas updated this revision to Diff 297395. eduucaldas added a comment. Add role sanity-check. Introduce `GetBegin()`. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D89147/new/ https://reviews.llvm.org/D89147 Files: clang/include/clang/Tooli

[PATCH] D89147: [SyntaxTree] Improve the signature of `replaceChildRangeLowLevel`.

2020-10-10 Thread Eduardo Caldas via Phabricator via cfe-commits
eduucaldas updated this revision to Diff 297396. eduucaldas added a comment. Fix whitespacing Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D89147/new/ https://reviews.llvm.org/D89147 Files: clang/include/clang/Tooling/Syntax/Tree.h clang/lib/T

[PATCH] D89148: [SyntaxTree] Artificial use of the Mutations API.

2020-10-10 Thread Eduardo Caldas via Phabricator via cfe-commits
eduucaldas updated this revision to Diff 297398. eduucaldas added a comment. Rebase Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D89148/new/ https://reviews.llvm.org/D89148 Files: clang/include/clang/Tooling/Syntax/Mutations.h clang/lib/Toolin

[PATCH] D89146: [SyntaxTree] Fix rtti for `Expression`.

2020-10-12 Thread Eduardo Caldas via Phabricator via cfe-commits
eduucaldas updated this revision to Diff 297502. eduucaldas added a comment. Rebase Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D89146/new/ https://reviews.llvm.org/D89146 Files: clang/include/clang/Tooling/Syntax/Nodes.h Index: clang/include

[PATCH] D89147: [SyntaxTree] Improve the signature of `replaceChildRangeLowLevel`.

2020-10-12 Thread Eduardo Caldas via Phabricator via cfe-commits
eduucaldas updated this revision to Diff 297511. eduucaldas added a comment. Add asserts to `MutationsImpl::remove` Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D89147/new/ https://reviews.llvm.org/D89147 Files: clang/include/clang/Tooling/Synta

[PATCH] D89148: [SyntaxTree] Artificial use of the Mutations API.

2020-10-12 Thread Eduardo Caldas via Phabricator via cfe-commits
eduucaldas added a subscriber: gribozavr2. eduucaldas added a comment. This patch implements the use case we discussed. It is merely for illustration. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D89148/new/ https://reviews.llvm.org/D89148 ___

[PATCH] D88106: [SyntaxTree] Provide iterator-like functions for Lists

2020-10-12 Thread Eduardo Caldas via Phabricator via cfe-commits
eduucaldas updated this revision to Diff 297574. eduucaldas marked 8 inline comments as done. eduucaldas added a comment. Answer comments, TODO: think about templated iterators Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D88106/new/ https://review

[PATCH] D89303: [SyntaxTree] Improve safety of `replaceChildRangeLowLevel`

2020-10-13 Thread Eduardo Caldas via Phabricator via cfe-commits
eduucaldas created this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. eduucaldas requested review of this revision. - Add assertions for other preconditions. - If nothing is modified, don't mark it. Repository: rG LLVM Github Monorepo https://reviews.llvm.or

[PATCH] D89303: [SyntaxTree] Improve safety of `replaceChildRangeLowLevel`

2020-10-13 Thread Eduardo Caldas via Phabricator via cfe-commits
eduucaldas updated this revision to Diff 297800. eduucaldas added a comment. minor Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D89303/new/ https://reviews.llvm.org/D89303 Files: clang/lib/Tooling/Syntax/Tree.cpp Index: clang/lib/Tooling/Synta

[PATCH] D89303: [SyntaxTree] Improve safety of `replaceChildRangeLowLevel`

2020-10-13 Thread Eduardo Caldas via Phabricator via cfe-commits
eduucaldas updated this revision to Diff 297803. eduucaldas added a comment. minor Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D89303/new/ https://reviews.llvm.org/D89303 Files: clang/lib/Tooling/Syntax/Tree.cpp Index: clang/lib/Tooling/Synta

[PATCH] D89303: [SyntaxTree] Improve safety of `replaceChildRangeLowLevel`

2020-10-13 Thread Eduardo Caldas via Phabricator via cfe-commits
eduucaldas added a reviewer: gribozavr2. eduucaldas added inline comments. Comment at: clang/lib/Tooling/Syntax/Tree.cpp:103 #ifndef NDEBUG - for (auto *N = New; N; N = N->getNextSibling()) { + for (auto *N = New; N; N = N->NextSibling) { assert(N->Parent == nullptr); ---

[PATCH] D89314: [SyntaxTree] Bug fix in `MutationsImpl::addAfter`.

2020-10-13 Thread Eduardo Caldas via Phabricator via cfe-commits
eduucaldas created this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. eduucaldas requested review of this revision. - Add assertions to other `MutationsImpl` member functions - `findPrevious` is a free function Repository: rG LLVM Github Monorepo https://rev

[PATCH] D89146: [SyntaxTree] Fix rtti for `Expression`.

2020-10-13 Thread Eduardo Caldas via Phabricator via cfe-commits
eduucaldas updated this revision to Diff 297842. eduucaldas added a comment. rebase Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D89146/new/ https://reviews.llvm.org/D89146 Files: clang/include/clang/Tooling/Syntax/Nodes.h Index: clang/include

[PATCH] D89146: [SyntaxTree] Fix rtti for `Expression`.

2020-10-13 Thread Eduardo Caldas via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGa8f1790fdb8c: [SyntaxTree] Fix rtti for `Expression`. (authored by eduucaldas). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION h

[PATCH] D89303: [SyntaxTree] Improve safety of `replaceChildRangeLowLevel`

2020-10-14 Thread Eduardo Caldas via Phabricator via cfe-commits
eduucaldas updated this revision to Diff 298079. eduucaldas marked 2 inline comments as done. eduucaldas added a comment. Answer to comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D89303/new/ https://reviews.llvm.org/D89303 Files: clang/li

[PATCH] D89303: [SyntaxTree] Improve safety of `replaceChildRangeLowLevel`

2020-10-14 Thread Eduardo Caldas via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG4178f8f2f08e: [SyntaxTree] Improve safety of `replaceChildRangeLowLevel` (authored by eduucaldas). Repository: rG LLVM Github Monorepo CHANGES SI

[PATCH] D89314: [SyntaxTree] Bug fix in `MutationsImpl::addAfter`.

2020-10-14 Thread Eduardo Caldas via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG72732acade77: [SyntaxTree] Bug fix in `MutationsImpl::addAfter`. (authored by eduucaldas). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST

[PATCH] D89303: [SyntaxTree] Improve safety of `replaceChildRangeLowLevel`

2020-10-14 Thread Eduardo Caldas via Phabricator via cfe-commits
eduucaldas marked an inline comment as done. eduucaldas added inline comments. Comment at: clang/lib/Tooling/Syntax/Tree.cpp:122 #endif + Node *&Begin = BeforeBegin ? BeforeBegin->NextSibling : FirstChild; + gribozavr2 wrote: > Could you move this definition up

[PATCH] D89148: [SyntaxTree] Artificial use of the Mutations API.

2020-10-14 Thread Eduardo Caldas via Phabricator via cfe-commits
eduucaldas updated this revision to Diff 298092. eduucaldas added a comment. Rebase Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D89148/new/ https://reviews.llvm.org/D89148 Files: clang/include/clang/Tooling/Syntax/Mutations.h clang/lib/Toolin

[PATCH] D88106: [SyntaxTree] Provide iterator-like functions for Lists

2020-10-14 Thread Eduardo Caldas via Phabricator via cfe-commits
eduucaldas updated this revision to Diff 298156. eduucaldas marked an inline comment as done. eduucaldas added a comment. - Make `ElementAndDelimiterIterator` templated. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D88106/new/ https://reviews.llvm.

[PATCH] D88106: [SyntaxTree] Provide iterator-like functions for Lists

2020-10-14 Thread Eduardo Caldas via Phabricator via cfe-commits
eduucaldas added a comment. Haven't yet implemented `BeforeBegin`, waiting for a heads up on the patch as is. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D88106/new/ https://reviews.llvm.org/D88106 ___

[PATCH] D88106: [SyntaxTree] Provide iterator-like functions for Lists

2020-10-14 Thread Eduardo Caldas via Phabricator via cfe-commits
eduucaldas added inline comments. Comment at: clang/include/clang/Tooling/Syntax/Tree.h:269 + return EDI == Other.EDI; +} + gribozavr2 wrote: > Please also define `operator!=`. this is defined by the `iterato_facade_base`, take a look at the comments in

[PATCH] D88106: [SyntaxTree] Provide iterator-like functions for Lists

2020-10-14 Thread Eduardo Caldas via Phabricator via cfe-commits
eduucaldas added inline comments. Comment at: clang/include/clang/Tooling/Syntax/Tree.h:241-242 /// "a; b; c" <=> [("a" , ";"), ("b" , ";" ), ("c" , null)] + template + class ElementAndDelimiterIterator + : public llvm::iterator_facade_base< Since we'

[PATCH] D88106: [SyntaxTree] Provide iterator-like functions for Lists

2020-10-15 Thread Eduardo Caldas via Phabricator via cfe-commits
eduucaldas updated this revision to Diff 298416. eduucaldas added a comment. - [SyntaxTree] `ElementAndDelimiterIterator` is polymorphic and supports `BeforeBegin` iterator Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D88106/new/ https://reviews.l

[PATCH] D88106: [SyntaxTree] Provide iterator-like functions for Lists

2020-10-15 Thread Eduardo Caldas via Phabricator via cfe-commits
eduucaldas updated this revision to Diff 298420. eduucaldas added a comment. Linting Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D88106/new/ https://reviews.llvm.org/D88106 Files: clang/include/clang/Tooling/Syntax/Tree.h clang/lib/Tooling/Sy

[PATCH] D88553: [clangd] Start using SyntaxTrees for folding ranges feature

2020-10-20 Thread Eduardo Caldas via Phabricator via cfe-commits
eduucaldas added inline comments. Comment at: clang-tools-extra/clangd/SemanticSelection.cpp:49-51 + if (Node->getKind() == syntax::NodeKind::CompoundStatement) { +const auto *Tree = dyn_cast(Node); +assert(Tree); Comment at: clang-to

[PATCH] D88106: [SyntaxTree] Provide iterator-like functions for Lists

2020-10-20 Thread Eduardo Caldas via Phabricator via cfe-commits
eduucaldas updated this revision to Diff 299347. eduucaldas marked 2 inline comments as not done. eduucaldas added a comment. Add tests, `ElementAndDelimiter` are input iterators Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D88106/new/ https://revi

[PATCH] D88106: [SyntaxTree] Provide iterator-like functions for Lists

2020-10-20 Thread Eduardo Caldas via Phabricator via cfe-commits
eduucaldas updated this revision to Diff 299348. eduucaldas added a comment. rename getBeforeBegin Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D88106/new/ https://reviews.llvm.org/D88106 Files: clang/include/clang/Tooling/Syntax/Tree.h clang/

[PATCH] D89794: [SyntaxTree] Implement "by-pointer output parameter to return value" refactoring.

2020-10-20 Thread Eduardo Caldas via Phabricator via cfe-commits
eduucaldas created this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. eduucaldas requested review of this revision. Example of such refactoring: Customer* C; getCustumer(C); Customer C = getCustumer(); Repository: rG LLVM Github Monorepo https://revi

[PATCH] D88553: [clangd] Start using SyntaxTrees for folding ranges feature

2020-10-21 Thread Eduardo Caldas via Phabricator via cfe-commits
eduucaldas added inline comments. Comment at: clang-tools-extra/clangd/SemanticSelection.cpp:52-55 +const syntax::Token *FirstToken = Tree->findFirstLeaf()->getToken(), +*LastToken = Tree->findLastLeaf()->getToken(); +assert(FirstToken->kind() == t

[PATCH] D88553: [clangd] Start using SyntaxTrees for folding ranges feature

2020-10-21 Thread Eduardo Caldas via Phabricator via cfe-commits
eduucaldas added inline comments. Comment at: clang/include/clang/Tooling/Syntax/Tree.h:172-174 /// Find the first node with a corresponding role. Node *findChild(NodeRole R); + const Node *findChild(NodeRole R) const; I think that makes sense, since all t

[PATCH] D90023: [Syntax] Add iterators over children of syntax trees.

2020-10-23 Thread Eduardo Caldas via Phabricator via cfe-commits
eduucaldas added a comment. Thanks Sam! I learned a lot from your patch ^^ Comment at: clang/include/clang/Tooling/Syntax/Tree.h:157-184 + /// Iterator over children (common base for const/non-const). + /// Not invalidated by tree mutations (holds a stable node pointer). + t

[PATCH] D90161: [SyntaxTree] Provide iterators for Lists

2020-10-26 Thread Eduardo Caldas via Phabricator via cfe-commits
eduucaldas created this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. eduucaldas requested review of this revision. Provide an iterator for `List` that iterates through elements and delimiters on pairs. This iterator is robust to missing elements. For instance,

[PATCH] D90023: [Syntax] Add iterators over children of syntax trees.

2020-10-26 Thread Eduardo Caldas via Phabricator via cfe-commits
eduucaldas accepted this revision. eduucaldas added a comment. Thanks for the instructive replies Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D90023/new/ https://reviews.llvm.org/D90023 ___ cfe-commits

[PATCH] D90161: [SyntaxTree] Provide iterators for Lists

2020-10-26 Thread Eduardo Caldas via Phabricator via cfe-commits
eduucaldas marked an inline comment as done. eduucaldas added a comment. In D90161#2353736 , @gribozavr2 wrote: > Could you add tests that verify the pairing of elements and delimiters? Those are surfaced through the previous tests, via `getElementsAsNod

[PATCH] D90161: [SyntaxTree] Provide iterators for Lists

2020-10-26 Thread Eduardo Caldas via Phabricator via cfe-commits
eduucaldas updated this revision to Diff 300696. eduucaldas added a comment. Fix comment. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D90161/new/ https://reviews.llvm.org/D90161 Files: clang/include/clang/Tooling/Syntax/Tree.h clang/unittests

[PATCH] D88106: [SyntaxTree] Provide iterator-like functions for Lists

2020-10-26 Thread Eduardo Caldas via Phabricator via cfe-commits
eduucaldas abandoned this revision. eduucaldas added inline comments. Comment at: clang/include/clang/Tooling/Syntax/Tree.h:252 + Kind = IteratorKind::NotSentinel; + if (isElement(Begin)) +Current = getWithDelimiter(cast(Begin)); Sin

[PATCH] D90161: [SyntaxTree] Provide iterators for Lists

2020-10-26 Thread Eduardo Caldas via Phabricator via cfe-commits
eduucaldas updated this revision to Diff 300702. eduucaldas added a comment. Diff against master, sorry about that Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D90161/new/ https://reviews.llvm.org/D90161 Files: clang/include/clang/Tooling/Syntax

[PATCH] D90240: [SyntaxTree] Add reverse links to syntax Nodes.

2020-10-27 Thread Eduardo Caldas via Phabricator via cfe-commits
eduucaldas created this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. eduucaldas requested review of this revision. Rationale: Children of a syntax tree had forward links only, because there was no need for reverse links. This need appeared when we started mutat

[PATCH] D90240: [SyntaxTree] Add reverse links to syntax Nodes.

2020-10-27 Thread Eduardo Caldas via Phabricator via cfe-commits
eduucaldas added a reviewer: gribozavr2. eduucaldas added a subscriber: sammccall. eduucaldas added inline comments. Comment at: clang/include/clang/Tooling/Syntax/Tree.h:189 /// EXPECTS: Child->Role != Detached void prependChildLowLevel(Node *Child); friend class TreeBu

[PATCH] D90161: [SyntaxTree] Provide iterators for Lists

2020-10-27 Thread Eduardo Caldas via Phabricator via cfe-commits
eduucaldas marked 8 inline comments as done. eduucaldas added a comment. I left some points unanswered, I'll answer them tomorrow :) Comment at: clang/include/clang/Tooling/Syntax/Tree.h:231 + /// `ElementAndDelimiter` acts as one. + template class ElementAndDelimiterIterato

[PATCH] D90161: [SyntaxTree] Provide iterators for Lists

2020-10-27 Thread Eduardo Caldas via Phabricator via cfe-commits
eduucaldas updated this revision to Diff 301024. eduucaldas marked 6 inline comments as done. eduucaldas added a comment. - `const` on `getElement` and similar. - `NotSentinel` -> `Element` Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D90161/new/ h

[PATCH] D90240: [SyntaxTree] Add reverse links to syntax Nodes.

2020-10-28 Thread Eduardo Caldas via Phabricator via cfe-commits
eduucaldas updated this revision to Diff 301198. eduucaldas marked 3 inline comments as done. eduucaldas added a comment. - `replaceChildRangeLowLevel` now takes Begin instead of BeforeBegin - `appendChildLowLevel` Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://review

[PATCH] D90240: [SyntaxTree] Add reverse links to syntax Nodes.

2020-10-28 Thread Eduardo Caldas via Phabricator via cfe-commits
eduucaldas marked 2 inline comments as done. eduucaldas added inline comments. Comment at: clang/include/clang/Tooling/Syntax/Tree.h:109 Node *getNextSibling() { return NextSibling; } + const Node *getPreviousSibling() const { return PreviousSibling; } + Node *getPreviousSib

[PATCH] D89794: [SyntaxTree] Implement "by-pointer output parameter to return value" refactoring.

2020-10-28 Thread Eduardo Caldas via Phabricator via cfe-commits
eduucaldas added a subscriber: gribozavr2. eduucaldas added a comment. This patch will build upon https://reviews.llvm.org/D90240 and https://reviews.llvm.org/D90161 When those patches land, work on this patch will resume. It is here to illustrate the relevance of the previous patches and the ge

[PATCH] D89794: [SyntaxTree] Implement "by-pointer output parameter to return value" refactoring.

2020-10-28 Thread Eduardo Caldas via Phabricator via cfe-commits
eduucaldas added a subscriber: sammccall. eduucaldas added a comment. Sam, this patch is outdated, as we're still making decisions on https://reviews.llvm.org/D90161 and we haven't yet landed https://reviews.llvm.org/D90240, please don't bother reviewing it. This is where we started thinking ab

[PATCH] D90240: [SyntaxTree] Add reverse links to syntax Nodes.

2020-10-28 Thread Eduardo Caldas via Phabricator via cfe-commits
eduucaldas updated this revision to Diff 301255. eduucaldas added a comment. Rebase to include ChildIterator patch. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D90240/new/ https://reviews.llvm.org/D90240 Files: clang/include/clang/Tooling/Synta

[PATCH] D90240: [SyntaxTree] Add reverse links to syntax Nodes.

2020-10-28 Thread Eduardo Caldas via Phabricator via cfe-commits
eduucaldas updated this revision to Diff 301256. eduucaldas added a comment. I was silly on the last rebase. Ignore this. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D90240/new/ https://reviews.llvm.org/D90240 Files: clang/include/clang/Tooling

[PATCH] D90240: [SyntaxTree] Add reverse links to syntax Nodes.

2020-10-28 Thread Eduardo Caldas via Phabricator via cfe-commits
eduucaldas updated this revision to Diff 301315. eduucaldas marked 9 inline comments as done. eduucaldas added a comment. Answered all comments but: - Add tests for `replaceChildRangeLowLevel` - Asymmetry of `replaceChildRangeLowLevel`, do we need to separate children of the replaced range? Re

<    1   2   3   4   5