diff options
author | Eduardo Caldas <ecaldas@google.com> | 2020-09-21 17:05:41 +0000 |
---|---|---|
committer | Eduardo Caldas <ecaldas@google.com> | 2020-09-22 09:15:21 +0000 |
commit | 66bcb14312a08b5d7e1197d23d748b2e23c4d852 (patch) | |
tree | c01fbc727c1649091ca1fb2335bfeb74a49ada73 /clang/unittests/Tooling/Syntax/TreeTest.cpp | |
parent | 28b84dd138666abc005de4810af16bcf007530ea (diff) | |
download | llvm-66bcb14312a08b5d7e1197d23d748b2e23c4d852.zip llvm-66bcb14312a08b5d7e1197d23d748b2e23c4d852.tar.gz llvm-66bcb14312a08b5d7e1197d23d748b2e23c4d852.tar.bz2 |
[SyntaxTree][Synthesis] Fix: `deepCopy` -> `deepCopyExpandingMacros`.
There can be Macros that are tagged with `modifiable`. Thus verifying
`canModifyAllDescendants` is not sufficient to avoid macros when deep
copying.
We think the `TokenBuffer` could inform us whether a `Token` comes from
a macro. We'll look into that when we can surface this information
easily, for instance in unit tests for `ComputeReplacements`.
Differential Revision: https://reviews.llvm.org/D88034
Diffstat (limited to 'clang/unittests/Tooling/Syntax/TreeTest.cpp')
-rw-r--r-- | clang/unittests/Tooling/Syntax/TreeTest.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/unittests/Tooling/Syntax/TreeTest.cpp b/clang/unittests/Tooling/Syntax/TreeTest.cpp index 2448db3..6e777b3 100644 --- a/clang/unittests/Tooling/Syntax/TreeTest.cpp +++ b/clang/unittests/Tooling/Syntax/TreeTest.cpp @@ -22,8 +22,8 @@ private: std::vector<std::pair<Node *, NodeRole>> ChildrenWithRoles; ChildrenWithRoles.reserve(Children.size()); for (const auto *Child : Children) { - ChildrenWithRoles.push_back( - std::make_pair(deepCopy(*Arena, Child), NodeRole::Unknown)); + ChildrenWithRoles.push_back(std::make_pair( + deepCopyExpandingMacros(*Arena, Child), NodeRole::Unknown)); } return clang::syntax::createTree(*Arena, ChildrenWithRoles, NodeKind::UnknownExpression); |