From 06e8d69ac7ae98f239dd66819477e3bbf245c4ac Mon Sep 17 00:00:00 2001 From: Argyrios Kyrtzidis Date: Fri, 31 Oct 2014 16:44:32 +0000 Subject: [PATCH] [libclang] Disable spell-checking and warnings during code-completion since they are not needed. llvm-svn: 220966 --- clang/lib/Frontend/ASTUnit.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/clang/lib/Frontend/ASTUnit.cpp b/clang/lib/Frontend/ASTUnit.cpp index bd81c0d60a59..c7d3d3f4c43d 100644 --- a/clang/lib/Frontend/ASTUnit.cpp +++ b/clang/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.