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 copy)." ================ Comment at: clang/lib/Tooling/Syntax/Synthesis.cpp:205 + if (L->canModify()) + syntax::FactoryImpl::setCanModify(Leaf); + ---------------- Since we are creating new leaves, why prohibit their mutation sometimes? I also don't quite understand the implications of having multiple leaves in a tree that are backed by the same token. I think the algorithm that produces edits can be confused by that. If you agree, please change the implementation to use `createLeaf` (or call it directly from `deepCopy`). ================ Comment at: clang/unittests/Tooling/Syntax/SynthesisTest.cpp:140 +TEST_P(SynthesisTest, Copy_Synthesized) { + buildTree("", GetParam()); ---------------- Copy => DeepCopy? (also in other tests) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D87749/new/ https://reviews.llvm.org/D87749 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits