]> granicus.if.org Git - clang/commitdiff
[libclang] Disable spell-checking and warnings during code-completion since they...
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Fri, 31 Oct 2014 16:44:32 +0000 (16:44 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Fri, 31 Oct 2014 16:44:32 +0000 (16:44 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220966 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Frontend/ASTUnit.cpp

index bd81c0d60a59a0775578b9f46c4f18b53e739f11..c7d3d3f4c43dd1732f88e6fff67dddfd22411bfb 100644 (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.