[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/

[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

[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

[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

[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:

[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));

[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

[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

[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 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-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). +

[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

[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() ==

[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

[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

[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/

[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:

[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

[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/

[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

[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 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/

[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

[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 * = BeforeBegin ? BeforeBegin->NextSibling : FirstChild; + gribozavr2 wrote: > Could you move this definition up so

[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

[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

[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:

[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

[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:

[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

[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] 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:

[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:

[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

[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/

[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] 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:

[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:

[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

[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

[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:

[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] 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:

[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

[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:

[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:

[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:

[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:

[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

[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

[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/

[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

[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:

[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 - | `-')'

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

2020-09-28 Thread Eduardo Caldas via Phabricator via cfe-commits
eduucaldas added a reviewer: gribozavr2. eduucaldas added inline comments. Comment at: clang/lib/Tooling/Syntax/BuildTree.cpp:594 +/// Shrink \p Range to a subrange that only contains tokens of a list. +ArrayRef shrinkToFitList(ArrayRef Range) { + auto BeginChildren

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

2020-09-28 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. After this change all nodes that have a delimited-list are using the `List` API. Implementation details: Let's look at a declaration with

[PATCH] D87839: [SyntaxTree] Test the List API

2020-09-22 Thread Eduardo Caldas via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGc3c08bfdfd62: [SyntaxTree] Test the List API (authored by eduucaldas). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D87839/new/

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

2020-09-22 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. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D88106 Files: clang/include/clang/Tooling/Syntax/Tree.h

[PATCH] D87839: [SyntaxTree] Test the List API

2020-09-22 Thread Eduardo Caldas via Phabricator via cfe-commits
eduucaldas marked an inline comment as done. eduucaldas added inline comments. Comment at: clang/include/clang/Tooling/Syntax/Tree.h:224 + /// "a, b c" <=> [("a", ","), ("b", nul), ("c", nul)] + /// "a, b,"<=> [("a", ","), ("b", ","), (nul, nul)] ///

[PATCH] D87839: [SyntaxTree] Test the List API

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

[PATCH] D87839: [SyntaxTree] Test the List API

2020-09-22 Thread Eduardo Caldas via Phabricator via cfe-commits
eduucaldas updated this revision to Diff 293489. eduucaldas marked 3 inline comments as done. eduucaldas added a comment. Answer code review. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D87839/new/ https://reviews.llvm.org/D87839 Files:

[PATCH] D88077: [SyntaxTree] Add tests for the assignment of the `canModify` tag.

2020-09-22 Thread Eduardo Caldas via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG6dc06fa09d1a: [SyntaxTree] Add tests for the assignment of the `canModify` tag. (authored by eduucaldas). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D88077: [SyntaxTree] Add tests for the assignment of the `canModify` tag.

2020-09-22 Thread Eduardo Caldas via Phabricator via cfe-commits
eduucaldas added a comment. Looking for feedback, specially on the names I used. Also if you have ideas of interesting tests they will be gladly accepted :) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D88077/new/ https://reviews.llvm.org/D88077

[PATCH] D87839: [SyntaxTree] Test the List API

2020-09-22 Thread Eduardo Caldas via Phabricator via cfe-commits
eduucaldas added a reviewer: gribozavr2. eduucaldas added a comment. I made a separate class for the tests on Lists, as it didn't share any methods with the tests for Trees. What do you think about that? Should I also put the tests for lists in a different file, even though `TreeTest.cpp`

[PATCH] D88077: [SyntaxTree] Add tests for the assignment of the `canModify` tag.

2020-09-22 Thread Eduardo Caldas via Phabricator via cfe-commits
eduucaldas added a reviewer: gribozavr2. eduucaldas added inline comments. Comment at: clang/unittests/Tooling/Syntax/BuildTreeTest.cpp:3858 -TEST_P(BuildSyntaxTreeTest, NonModifiableNodes) { - // Some nodes are non-modifiable, they are marked with 'I:'.

[PATCH] D88077: [SyntaxTree] Add tests for the assignment of the `canModify` tag.

2020-09-22 Thread Eduardo Caldas via Phabricator via cfe-commits
eduucaldas updated this revision to Diff 293389. eduucaldas added a comment. Add FIXME for `MIN(X, Y)` Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D88077/new/ https://reviews.llvm.org/D88077 Files:

[PATCH] D87839: [SyntaxTree] Test the List API

2020-09-22 Thread Eduardo Caldas via Phabricator via cfe-commits
eduucaldas updated this revision to Diff 293386. eduucaldas added a comment. - [SyntaxTree] Split `TreeTest` and `ListTest` testing fixtures. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D87839/new/ https://reviews.llvm.org/D87839 Files:

[PATCH] D88034: [SyntaxTree][Synthesis] Fix: `deepCopy` -> `deepCopyExpandingMacros`.

2020-09-22 Thread Eduardo Caldas via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG66bcb14312a0: [SyntaxTree][Synthesis] Fix: `deepCopy` - `deepCopyExpandingMacros`. (authored by eduucaldas). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D88077: [SyntaxTree] Add tests for the assignment of the `canModify` tag.

2020-09-22 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. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D88077 Files: clang/unittests/Tooling/Syntax/BuildTreeTest.cpp Index:

[PATCH] D88034: [SyntaxTree][Synthesis] Implement `deepCopyExpandingMacros`

2020-09-22 Thread Eduardo Caldas via Phabricator via cfe-commits
eduucaldas updated this revision to Diff 293363. eduucaldas added a comment. . Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D88034/new/ https://reviews.llvm.org/D88034 Files: clang/include/clang/Tooling/Syntax/BuildTree.h

[PATCH] D88034: [SyntaxTree][Synthesis] Implement `deepCopyExpandingMacros`

2020-09-22 Thread Eduardo Caldas via Phabricator via cfe-commits
eduucaldas updated this revision to Diff 293361. eduucaldas added a comment. Remove buggy `deepCopy` Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D88034/new/ https://reviews.llvm.org/D88034 Files: clang/include/clang/Tooling/Syntax/BuildTree.h

[PATCH] D87779: [SyntaxTree] Test `findFirstLeaf` and `findLastLeaf`

2020-09-22 Thread Eduardo Caldas via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGaf582c9b0f3a: [SyntaxTree] Test `findFirstLeaf` and `findLastLeaf` (authored by eduucaldas). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D87779/new/

[PATCH] D88024: [SyntaxTree][Nit] Take `ArrayRef` instead of `std::vector` as argument for `createTree`

2020-09-22 Thread Eduardo Caldas via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG1dc7836aed13: [SyntaxTree][Nit] Take `ArrayRef` instead of `std::vector` as argument for… (authored by eduucaldas). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D88034: [SyntaxTree][Synthesis] Implement `deepCopyExpandingMacros`

2020-09-21 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. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D88034 Files: clang/include/clang/Tooling/Syntax/BuildTree.h

[PATCH] D88024: [SyntaxTree][Nit] Take `ArrayRef` instead of `std::vector` as argument for `createTree`

2020-09-21 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. I also assured that there are no other functions unnecessarily using std::vector as argument.

[PATCH] D87779: [SyntaxTree] Test `findFirstLeaf` and `findLastLeaf`

2020-09-21 Thread Eduardo Caldas via Phabricator via cfe-commits
eduucaldas updated this revision to Diff 293167. eduucaldas added a comment. Comment `generateAllTreesWithShape` Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D87779/new/ https://reviews.llvm.org/D87779 Files: clang/lib/Tooling/Syntax/Tree.cpp

[PATCH] D87779: [SyntaxTree] Test `findFirstLeaf` and `findLastLeaf`

2020-09-21 Thread Eduardo Caldas via Phabricator via cfe-commits
eduucaldas updated this revision to Diff 293163. eduucaldas marked 3 inline comments as done. eduucaldas added a comment. - Answer Review - Change names in `generateAllTreesWithShape` - `auto x = vector()` -> `vector x;` Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

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

2020-09-21 Thread Eduardo Caldas via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG87f0b51d68de: [SyntaxTree][NFC] follow naming convention + remove auto on empty vector… (authored by eduucaldas). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D87749: [SyntaxTree][Synthesis] Implement `deepCopy`

2020-09-21 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 rG4a5cc389c51d: [SyntaxTree][Synthesis] Implement `deepCopy` (authored by eduucaldas). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST

[PATCH] D87749: [SyntaxTree][Synthesis] Implement `deepCopy`

2020-09-21 Thread Eduardo Caldas via Phabricator via cfe-commits
eduucaldas updated this revision to Diff 293101. eduucaldas added a comment. . Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D87749/new/ https://reviews.llvm.org/D87749 Files: clang/include/clang/Tooling/Syntax/BuildTree.h

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

2020-09-21 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. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D88004 Files: clang/lib/Tooling/Syntax/BuildTree.cpp

[PATCH] D87749: [SyntaxTree][Synthesis] Implement `deepCopy`

2020-09-21 Thread Eduardo Caldas via Phabricator via cfe-commits
eduucaldas updated this revision to Diff 293089. eduucaldas marked 3 inline comments as done. eduucaldas added a comment. Fix canModifyAllDescendants, add tests for it Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D87749/new/

[PATCH] D87749: [SyntaxTree][Synthesis] Implement `deepCopy`

2020-09-21 Thread Eduardo Caldas via Phabricator via cfe-commits
eduucaldas added inline comments. Comment at: clang/lib/Tooling/Syntax/Synthesis.cpp:237 + +syntax::Node *clang::syntax::deepCopy(syntax::Arena , const Node *N) { + if (!canModifyAllDescendants(N)) We are ignoring nullability of pointers. The casting machinery

[PATCH] D87749: [SyntaxTree][Synthesis] Implement `deepCopy`

2020-09-21 Thread Eduardo Caldas via Phabricator via cfe-commits
eduucaldas updated this revision to Diff 293085. eduucaldas marked 3 inline comments as done. eduucaldas added a comment. - `deepCopy` returns `nullptr` if copy code with Macro expansions. - `deepCopy` also deep copies the Tokens. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D87895: [SyntaxTree] Test for '\' inside token.

2020-09-21 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 rGe616a4259889: [SyntaxTree] Test for \ inside token. (authored by eduucaldas). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D87896: [SyntaxTree][Synthesis] Improve testing `createLeaf`

2020-09-21 Thread Eduardo Caldas via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGbb5b28f12fbd: [SyntaxTree][Synthesis] Improve testing `createLeaf` (authored by eduucaldas). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D87896/new/

[PATCH] D87925: [Synthesis] Fix: `createTree` only from children that are not backed by source code

2020-09-18 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. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D87925 Files: clang/include/clang/Tooling/Syntax/BuildTree.h

[PATCH] D87895: [SyntaxTree] Test for '\' inside token.

2020-09-18 Thread Eduardo Caldas via Phabricator via cfe-commits
eduucaldas updated this revision to Diff 292832. eduucaldas added a comment. Fix typo Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D87895/new/ https://reviews.llvm.org/D87895 Files: clang/unittests/Tooling/Syntax/BuildTreeTest.cpp Index:

[PATCH] D87896: [SyntaxTree][Synthesis] Improve testing `createLeaf`

2020-09-18 Thread Eduardo Caldas via Phabricator via cfe-commits
eduucaldas updated this revision to Diff 292831. eduucaldas added a comment. rebase Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D87896/new/ https://reviews.llvm.org/D87896 Files: clang/unittests/Tooling/Syntax/SynthesisTest.cpp Index:

[PATCH] D87896: [SyntaxTree][Synthesis] Improve testing `createLeaf`

2020-09-18 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. The new test shows that `createLeaf` depends on the C++ version. Repository: rG LLVM Github Monorepo

[PATCH] D87895: [SyntaxTree] Test for '\' inside token.

2020-09-18 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/D87895 Files:

[PATCH] D87839: [SyntaxTree] Test the List API

2020-09-17 Thread Eduardo Caldas via Phabricator via cfe-commits
eduucaldas updated this revision to Diff 292547. eduucaldas added a comment. Apply arc lint patch Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D87839/new/ https://reviews.llvm.org/D87839 Files: clang/include/clang/Tooling/Syntax/Tree.h

[PATCH] D87839: [SyntaxTree] Test the List API

2020-09-17 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. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D87839 Files: clang/include/clang/Tooling/Syntax/Tree.h

[PATCH] D87749: [SyntaxTree][Synthesis] Implement `deepCopy`

2020-09-17 Thread Eduardo Caldas via Phabricator via cfe-commits
eduucaldas updated this revision to Diff 292539. eduucaldas added a comment. Rebase Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D87749/new/ https://reviews.llvm.org/D87749 Files: clang/include/clang/Tooling/Syntax/BuildTree.h

[PATCH] D87820: [SyntaxTree][Synthesis] Fix allocation in `createTree` for more general use

2020-09-17 Thread Eduardo Caldas via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG1e19165bd89d: [SyntaxTree][Synthesis] Fix allocation in `createTree` for more general use (authored by eduucaldas). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D87820: [SyntaxTree][Synthesis] Fix allocation in `createTree` for more general use

2020-09-17 Thread Eduardo Caldas via Phabricator via cfe-commits
eduucaldas updated this revision to Diff 292444. eduucaldas edited the summary of this revision. eduucaldas added a comment. Fix comment Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D87820/new/ https://reviews.llvm.org/D87820 Files:

[PATCH] D87820: [SyntaxTree][Synthesis] Fix allocation in `createTree` for more general use

2020-09-17 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. Prior to this change `createTree` could not create arbitrary syntax trees. Now it dispatches to the

[PATCH] D87779: [SyntaxTree] Test `findFirstLeaf` and `findLastLeaf`

2020-09-16 Thread Eduardo Caldas via Phabricator via cfe-commits
eduucaldas created this revision. Herald added subscribers: cfe-commits, mgorny. Herald added a project: clang. eduucaldas requested review of this revision. - Introduce `TreeTest.cpp` to unit test `Tree.h` - Add `generateAllTreesWithShape` to generating test cases - Add tests for `findFirstLeaf`

[PATCH] D87749: [SyntaxTree][Synthesis] Implement `deepCopy`

2020-09-16 Thread Eduardo Caldas via Phabricator via cfe-commits
eduucaldas updated this revision to Diff 292145. eduucaldas added a comment. Remove extraneous qualifiers in `createTree` Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D87749/new/ https://reviews.llvm.org/D87749 Files:

  1   2   3   4   5   >