[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; llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> VFS = Input.VFS;
if (Input.Preamble && Input.Preamble->StatCache) if (Input.Preamble && Input.Preamble->StatCache)
VFS = Input.Preamble->StatCache->getConsumingFS(std::move(VFS)); VFS = Input.Preamble->StatCache->getConsumingFS(std::move(VFS));
auto CI = buildCompilerInvocation( ParseInputs PInput;
ParseInputs{Input.Command, VFS, Input.Contents, PInput.CompileCommand = Input.Command;
tidy::ClangTidyOptions::getDefaults()}); PInput.FS = VFS;
PInput.Contents = Input.Contents;
auto CI = buildCompilerInvocation(PInput);
if (!CI) { if (!CI) {
elog("Couldn't create CompilerInvocation"); elog("Couldn't create CompilerInvocation");
return false; return false;