[Tooling] JSONCompilationDatabase::loadFromBuffer retains the buffer, copy it.
authorSam McCall <sam.mccall@gmail.com>
Fri, 4 Dec 2020 10:34:30 +0000 (11:34 +0100)
committerSam McCall <sam.mccall@gmail.com>
Fri, 4 Dec 2020 20:54:55 +0000 (21:54 +0100)
commit650e04e179c9d355cd6d8f9a108d60c7969d24ca
tree9faee16e84b4c3b2462728b1b30bc761be588cbe
parentd10f9863a5ac1cb681af07719650c44b48f289ce
[Tooling] JSONCompilationDatabase::loadFromBuffer retains the buffer, copy it.

This function doesn't seem to be used in-tree outside tests.
However clangd wants to use it soon, and having the CDB be self-contained seems
reasonable.

Differential Revision: https://reviews.llvm.org/D92646
clang/lib/Tooling/JSONCompilationDatabase.cpp
clang/unittests/Tooling/CompilationDatabaseTest.cpp