[SyntaxTree][Synthesis] Fix allocation in `createTree` for more general use
authorEduardo Caldas <ecaldas@google.com>
Thu, 17 Sep 2020 09:32:46 +0000 (09:32 +0000)
committerEduardo Caldas <ecaldas@google.com>
Thu, 17 Sep 2020 16:09:35 +0000 (16:09 +0000)
commit1e19165bd89db6671a80e0b25b32d5c7ae79455c
tree3b0adcfd606d436726f522103cecb9ca9a03816c
parent7d593d0d6905b55ca1124fca5e4d1ebb17203138
[SyntaxTree][Synthesis] Fix allocation in `createTree` for more general use

Prior to this change `createTree` could not create arbitrary syntax
trees. Now it dispatches to the constructor of the concrete syntax tree
according to the `NodeKind` passed as argument. This allows reuse inside
the Synthesis API.  # Please enter the commit message for your changes.
Lines starting

Differential Revision: https://reviews.llvm.org/D87820
clang/include/clang/Tooling/Syntax/BuildTree.h
clang/lib/Tooling/Syntax/Synthesis.cpp