From 2b4074f1d3919e77cb33ca49c960521dea27afab Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Tue, 1 Dec 2009 05:55:20 +0000 Subject: Switch the clang-to-CIndex interface for code-completion to a binary format, for a massive speedup git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90209 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Frontend/CompilerInstance.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib/Frontend/CompilerInstance.cpp') diff --git a/lib/Frontend/CompilerInstance.cpp b/lib/Frontend/CompilerInstance.cpp index 1cb5993fae..1083d5ef1c 100644 --- a/lib/Frontend/CompilerInstance.cpp +++ b/lib/Frontend/CompilerInstance.cpp @@ -29,6 +29,7 @@ #include "llvm/Support/raw_ostream.h" #include "llvm/Support/Timer.h" #include "llvm/System/Path.h" +#include "llvm/System/Program.h" using namespace clang; CompilerInstance::CompilerInstance(llvm::LLVMContext *_LLVMContext, @@ -256,6 +257,12 @@ void CompilerInstance::createCodeCompletionConsumer() { getFrontendOpts().DebugCodeCompletionPrinter, getFrontendOpts().ShowMacrosInCodeCompletion, llvm::outs())); + + if (CompletionConsumer->isOutputBinary() && + llvm::sys::Program::ChangeStdoutToBinary()) { + getPreprocessor().getDiagnostics().Report(diag::err_fe_stdout_binary); + CompletionConsumer.reset(); + } } void CompilerInstance::createFrontendTimer() { -- cgit v1.2.3-18-g5258