aboutsummaryrefslogtreecommitdiff
path: root/lib/Driver/Driver.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Driver/Driver.cpp')
-rw-r--r--lib/Driver/Driver.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/Driver/Driver.cpp b/lib/Driver/Driver.cpp
index d510a0f4f6..e22fc658a8 100644
--- a/lib/Driver/Driver.cpp
+++ b/lib/Driver/Driver.cpp
@@ -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.