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)
diff --git a/lib/Frontend/CompilerInvocation.cpp b/lib/Frontend/CompilerInvocation.cpp
index 942bc0d..b4bb613 100644
--- a/lib/Frontend/CompilerInvocation.cpp
+++ b/lib/Frontend/CompilerInvocation.cpp
@@ -253,8 +253,6 @@
     Res.push_back("-fcolor-diagnostics");
   if (Opts.VerifyDiagnostics)
     Res.push_back("-verify");
-  if (Opts.BinaryOutput)
-    Res.push_back("-fdiagnostics-binary");
   if (Opts.ShowOptionNames)
     Res.push_back("-fdiagnostics-show-option");
   if (Opts.ShowCategories == 1)
@@ -960,7 +958,6 @@
   Opts.ShowSourceRanges = Args.hasArg(OPT_fdiagnostics_print_source_range_info);
   Opts.ShowParseableFixits = Args.hasArg(OPT_fdiagnostics_parseable_fixits);
   Opts.VerifyDiagnostics = Args.hasArg(OPT_verify);
-  Opts.BinaryOutput = Args.hasArg(OPT_fdiagnostics_binary);
   Opts.ErrorLimit = Args.getLastArgIntValue(OPT_ferror_limit, 0, Diags);
   Opts.MacroBacktraceLimit
     = Args.getLastArgIntValue(OPT_fmacro_backtrace_limit,