[clangd] Followup fix of rL351818

ClangTidyOptions::getDefaults is not free, it will initialize all
clang-tidy modules to get check-specific options, and we don't use this
information in CodeComplete, so using an empty one (constructed by
default constructor) is sufficient.

llvm-svn: 351826
This commit is contained in:
Haojian Wu 2019-01-22 14:48:04 +00:00
parent effee52c59
commit 32cd41f229
1 changed files with 5 additions and 3 deletions

View File

@ -1019,9 +1019,11 @@ bool semaCodeComplete(std::unique_ptr<CodeCompleteConsumer> Consumer,
llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> VFS = Input.VFS;
if (Input.Preamble && Input.Preamble->StatCache)
VFS = Input.Preamble->StatCache->getConsumingFS(std::move(VFS));
auto CI = buildCompilerInvocation(
ParseInputs{Input.Command, VFS, Input.Contents,
tidy::ClangTidyOptions::getDefaults()});
ParseInputs PInput;
PInput.CompileCommand = Input.Command;
PInput.FS = VFS;
PInput.Contents = Input.Contents;
auto CI = buildCompilerInvocation(PInput);
if (!CI) {
elog("Couldn't create CompilerInvocation");
return false;