[libclang] Disable spell-checking and warnings during code-completion since they are not needed.

llvm-svn: 220966
This commit is contained in:
Argyrios Kyrtzidis 2014-10-31 16:44:32 +00:00
parent d92da47707
commit 06e8d69ac7
1 changed files with 4 additions and 0 deletions

View File

@ -2326,6 +2326,10 @@ void ASTUnit::CodeComplete(StringRef File, unsigned Line, unsigned Column,
// Set the language options appropriately.
LangOpts = *CCInvocation->getLangOpts();
// Spell-checking and warnings are wasteful during code-completion.
LangOpts.SpellChecking = false;
CCInvocation->getDiagnosticOpts().IgnoreWarnings = true;
std::unique_ptr<CompilerInstance> Clang(new CompilerInstance());
// Recover resources if we crash before exiting this method.