[cfe-commits] r156096 - /cfe/trunk/lib/Driver/Driver.cpp

Chad Rosier mcrosier at apple.com
Thu May 3 13:17:15 PDT 2012


Author: mcrosier
Date: Thu May  3 15:17:15 2012
New Revision: 156096

URL: http://llvm.org/viewvc/llvm-project?rev=156096&view=rev
Log:
[driver - crash diagnostics] Only write the failing command in the script.
Part of rdar://11285725

Modified:
    cfe/trunk/lib/Driver/Driver.cpp

Modified: cfe/trunk/lib/Driver/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Driver.cpp?rev=156096&r1=156095&r2=156096&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Driver.cpp (original)
+++ cfe/trunk/lib/Driver/Driver.cpp Thu May  3 15:17:15 2012
@@ -393,7 +393,12 @@
   // 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.





More information about the cfe-commits mailing list