From 32cd41f2297f1b70ff4a59b491a3d2399f55097a Mon Sep 17 00:00:00 2001 From: Haojian Wu Date: Tue, 22 Jan 2019 14:48:04 +0000 Subject: [PATCH] [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 --- clang-tools-extra/clangd/CodeComplete.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/clang-tools-extra/clangd/CodeComplete.cpp b/clang-tools-extra/clangd/CodeComplete.cpp index 40b4c78d2093..e1be6b4527d0 100644 --- a/clang-tools-extra/clangd/CodeComplete.cpp +++ b/clang-tools-extra/clangd/CodeComplete.cpp @@ -1019,9 +1019,11 @@ bool semaCodeComplete(std::unique_ptr Consumer, llvm::IntrusiveRefCntPtr 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;