Eliminate -fdiagnostics-binary and all of the infrastructure for
emitting diagnostics in a binary form to be consumed by libclang,
since libclang no longer does any of its work out-of-process, making
this code dead. Besides, this stuff never worked at 100% anyway.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116250 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Frontend/CompilerInstance.cpp b/lib/Frontend/CompilerInstance.cpp
index 9397663..44e5fd2 100644
--- a/lib/Frontend/CompilerInstance.cpp
+++ b/lib/Frontend/CompilerInstance.cpp
@@ -90,24 +90,6 @@
 }
 
 // Diagnostics
-namespace {
-  class BinaryDiagnosticSerializer : public DiagnosticClient {
-    llvm::raw_ostream &OS;
-    SourceManager *SourceMgr;
-  public:
-    explicit BinaryDiagnosticSerializer(llvm::raw_ostream &OS)
-      : OS(OS), SourceMgr(0) { }
-
-    virtual void HandleDiagnostic(Diagnostic::Level DiagLevel,
-                                  const DiagnosticInfo &Info);
-  };
-}
-
-void BinaryDiagnosticSerializer::HandleDiagnostic(Diagnostic::Level DiagLevel,
-                                                  const DiagnosticInfo &Info) {
-  StoredDiagnostic(DiagLevel, Info).Serialize(OS);
-}
-
 static void SetUpBuildDumpLog(const DiagnosticOptions &DiagOpts,
                               unsigned argc, const char* const *argv,
                               Diagnostic &Diags) {
@@ -143,21 +125,7 @@
   // Create the diagnostic client for reporting errors or for
   // implementing -verify.
   llvm::OwningPtr<DiagnosticClient> DiagClient;
-  if (Opts.BinaryOutput) {
-    if (llvm::sys::Program::ChangeStderrToBinary()) {
-      // We weren't able to set standard error to binary, which is a
-      // bit of a problem. So, just create a text diagnostic printer
-      // to complain about this problem, and pretend that the user
-      // didn't try to use binary output.
-      Diags->setClient(new TextDiagnosticPrinter(llvm::errs(), Opts));
-      Diags->Report(diag::err_fe_stderr_binary);
-      return Diags;
-    } else {
-      Diags->setClient(new BinaryDiagnosticSerializer(llvm::errs()));
-    }
-  } else {
-    Diags->setClient(new TextDiagnosticPrinter(llvm::errs(), Opts));
-  }
+  Diags->setClient(new TextDiagnosticPrinter(llvm::errs(), Opts));
 
   // Chain in -verify checker, if requested.
   if (Opts.VerifyDiagnostics)