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

2020-09-21 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 added inline comments. Comment at: clang/lib/Tooling/Syntax/Synthesis.cpp:205 + if (L->canModify()) +syntax::FactoryImpl::setCanModify(Leaf); + eduucaldas wrote: > gribozavr2 wrote: > > Since we are creating new leaves, why prohibit their

[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] 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 Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 added inline comments. Comment at: clang/lib/Tooling/Syntax/Synthesis.cpp:216 + Child = Child->getNextSibling()) +if (!Child->canModify()) + return false; Shouldn't we call canModifyAllDescendants recursively? Comment

[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] D87749: [SyntaxTree][Synthesis] Implement `deepCopy`

2020-09-17 Thread Dmitri Gribenko via Phabricator via cfe-commits
gribozavr2 accepted this revision. gribozavr2 added inline comments. This revision is now accepted and ready to land. Comment at: clang/include/clang/Tooling/Syntax/BuildTree.h:45 +/// Deep copies `N`. +/// "Creates a completely independent copy of `N` (a deep

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

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

2020-09-16 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/D87749 Files: