[clangd] Fix memory leak in ClangdTests.
authorHaojian Wu <hokein@google.com>
Fri, 14 Dec 2018 13:19:38 +0000 (13:19 +0000)
committerHaojian Wu <hokein@google.com>
Fri, 14 Dec 2018 13:19:38 +0000 (13:19 +0000)
commit23ae22b66927479a8b828f7f580bd02a6113e049
tree9c850e8c3d3a796b32e1ce99d35664e477011379
parentd5a78e6e594bcf8dc7502fb5cb7396c0936eb224
[clangd] Fix memory leak in ClangdTests.

Summary:
createInvocationFromCommandLine sets DisableFree to true by default,
which leads memory leak in clangd. The fix is to  use the `BuildCompilationInvocation`
to create CI with the correct options (DisableFree is false).

Fix https://bugs.llvm.org/show_bug.cgi?id=39991.

Reviewers: kadircet

Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, cfe-commits

Differential Revision: https://reviews.llvm.org/D55702

llvm-svn: 349145
clang-tools-extra/unittests/clangd/TestTU.cpp