aboutsummaryrefslogtreecommitdiff
path: root/clang/unittests/Tooling/Syntax/TreeTest.cpp
diff options
context:
space:
mode:
authorEduardo Caldas <ecaldas@google.com>2020-09-21 17:05:41 +0000
committerEduardo Caldas <ecaldas@google.com>2020-09-22 09:15:21 +0000
commit66bcb14312a08b5d7e1197d23d748b2e23c4d852 (patch)
treec01fbc727c1649091ca1fb2335bfeb74a49ada73 /clang/unittests/Tooling/Syntax/TreeTest.cpp
parent28b84dd138666abc005de4810af16bcf007530ea (diff)
downloadllvm-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.cpp4
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);