[Syntax] Assert invariants on tree structure and fix a bug in mutations
authorIlya Biryukov <ibiryukov@google.com>
Tue, 14 Jan 2020 15:07:11 +0000 (16:07 +0100)
committerIlya Biryukov <ibiryukov@google.com>
Tue, 14 Jan 2020 15:31:08 +0000 (16:31 +0100)
commit3b929fe7763570fc1d4a4691a53257a4a0b7760e
tree4256e18725166442080ba975fd0a3472c07c336c
parent9738c757bd9bc2fdca935f2b4e356f1d5e5f3682
[Syntax] Assert invariants on tree structure and fix a bug in mutations

Add checks for some structural invariants when building and mutating
the syntax trees.

Fix a bug failing the invariants after mutations: the parent of nodes
added into the tree was null.
clang/include/clang/Tooling/Syntax/Tree.h
clang/lib/Tooling/Syntax/BuildTree.cpp
clang/lib/Tooling/Syntax/Mutations.cpp
clang/lib/Tooling/Syntax/Synthesis.cpp
clang/lib/Tooling/Syntax/Tree.cpp