From: Argyrios Kyrtzidis Date: Fri, 31 Oct 2014 16:44:32 +0000 (+0000) Subject: [libclang] Disable spell-checking and warnings during code-completion since they... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a155890d1fab6388e3564e44738a49f300429123;p=clang [libclang] Disable spell-checking and warnings during code-completion since they are not needed. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220966 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Frontend/ASTUnit.cpp b/lib/Frontend/ASTUnit.cpp index bd81c0d60a..c7d3d3f4c4 100644 --- a/lib/Frontend/ASTUnit.cpp +++ b/lib/Frontend/ASTUnit.cpp @@ -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 Clang(new CompilerInstance()); // Recover resources if we crash before exiting this method.