]> granicus.if.org Git - clang/commitdiff
[driver - crash diagnostics] Only write the failing command in the script.
authorChad Rosier <mcrosier@apple.com>
Thu, 3 May 2012 20:17:15 +0000 (20:17 +0000)
committerChad Rosier <mcrosier@apple.com>
Thu, 3 May 2012 20:17:15 +0000 (20:17 +0000)
Part of rdar://11285725

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156096 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/Driver.cpp

index d510a0f4f68f96d31bf331948609e3d4d97594bf..e22fc658a8c26ce3b7448bbca486d0ea19b7790d 100644 (file)
@@ -393,7 +393,12 @@ void Driver::generateCompilationDiagnostics(Compilation &C,
   // Save the original job command(s).
   std::string Cmd;
   llvm::raw_string_ostream OS(Cmd);
-  C.PrintJob(OS, C.getJobs(), "\n", false);
+  if (FailingCommand)
+    C.PrintJob(OS, *FailingCommand, "\n", false);
+  else
+    // Crash triggered by FORCE_CLANG_DIAGNOSTICS_CRASH, which doesn't have an 
+    // associated FailingCommand, so just pass all jobs.
+    C.PrintJob(OS, C.getJobs(), "\n", false);
   OS.flush();
 
   // Clear stale state and suppress tool output.