Driver: Quote the command in crash reproduction scripts.

This fixes crash report generation when filenames have spaces. It also
removes an awkward workaround that quoted *some* arguments when
generating crash reports.

llvm-svn: 220307
diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp
index baf154f..ccefbd8 100644
--- a/clang/lib/Driver/Driver.cpp
+++ b/clang/lib/Driver/Driver.cpp
@@ -547,7 +547,7 @@
     Diag(clang::diag::note_drv_command_failed_diag_msg)
         << "Error generating run script: " + Script + " " + EC.message();
   } else {
-    Cmd.Print(ScriptOS, "\n", /*Quote=*/false, &CrashInfo);
+    Cmd.Print(ScriptOS, "\n", /*Quote=*/true, &CrashInfo);
     Diag(clang::diag::note_drv_command_failed_diag_msg) << Script;
   }
   Diag(clang::diag::note_drv_command_failed_diag_msg)
diff --git a/clang/lib/Driver/Job.cpp b/clang/lib/Driver/Job.cpp
index 34d38b9..c5b3f5a 100644
--- a/clang/lib/Driver/Job.cpp
+++ b/clang/lib/Driver/Job.cpp
@@ -73,12 +73,6 @@
   return 0;
 }
 
-static bool quoteNextArg(const char *flag) {
-  return llvm::StringSwitch<bool>(flag)
-    .Case("-D", true)
-    .Default(false);
-}
-
 static void PrintArg(raw_ostream &OS, const char *Arg, bool Quote) {
   const bool Escape = std::strpbrk(Arg, "\"\\$");
 
@@ -189,11 +183,6 @@
 
     OS << ' ';
     PrintArg(OS, Arg, Quote);
-
-    if (CrashInfo && quoteNextArg(Arg) && i + 1 < e) {
-      OS << ' ';
-      PrintArg(OS, Args[++i], true);
-    }
   }
 
   if (CrashInfo && !CrashInfo->VFSPath.empty()) {