From 53d2409a223a14d063faf06e4360ede09c41ed80 Mon Sep 17 00:00:00 2001 From: Chad Rosier Date: Thu, 3 May 2012 20:17:15 +0000 Subject: [PATCH] [driver - crash diagnostics] Only write the failing command in the script. 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 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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. -- 2.40.0