[clangd] Correct setting ignoreWarnings in CodeCompletion.
authorHaojian Wu <hokein@google.com>
Thu, 22 Feb 2018 13:35:01 +0000 (13:35 +0000)
committerHaojian Wu <hokein@google.com>
Thu, 22 Feb 2018 13:35:01 +0000 (13:35 +0000)
commitb603a5e0e3760eb8148e327bb184d60d6b6bfbd7
tree2640be9123cff5af4c679a3cb6022151bc1604cf
parent1fb81bcb9bb4ba5571b24847713894623e67a926
[clangd] Correct setting ignoreWarnings in CodeCompletion.

Summary:
We should set the flag before creating ComplierInstance -- when
CopmilerInstance gets initialized, it also initializes the DiagnosticsEngine
using the DiagnosticOptions.

This was hidden deeply -- as clang suppresses all diagnostics when we
hit the code-completion (but internally it does do unnecessary analysis stuff).

As a bonus point, this fix will optmize the completion speed -- clang won't do
any analysis (e.g. -Wunreachable-code, -Wthread-safety-analysisi) at all internally.

Reviewers: ilya-biryukov

Reviewed By: ilya-biryukov

Subscribers: klimek, jkorous-apple, ioeric, cfe-commits

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

llvm-svn: 325779
clang-tools-extra/clangd/CodeComplete.cpp
clang-tools-extra/clangd/Headers.cpp