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

Argyrios Kyrtzidis akyrtzi at gmail.com
Fri Oct 31 09:44:33 PDT 2014


Author: akirtzidis
Date: Fri Oct 31 11:44:32 2014
New Revision: 220966

URL: http://llvm.org/viewvc/llvm-project?rev=220966&view=rev
Log:
[libclang] Disable spell-checking and warnings during code-completion since they are not needed.

Modified:
    cfe/trunk/lib/Frontend/ASTUnit.cpp

Modified: cfe/trunk/lib/Frontend/ASTUnit.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/ASTUnit.cpp?rev=220966&r1=220965&r2=220966&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/ASTUnit.cpp (original)
+++ cfe/trunk/lib/Frontend/ASTUnit.cpp Fri Oct 31 11:44:32 2014
@@ -2326,6 +2326,10 @@ void ASTUnit::CodeComplete(StringRef Fil
   // 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.





More information about the cfe-commits mailing list