From: Reid Kleckner Date: Mon, 7 Jul 2014 20:23:27 +0000 (+0000) Subject: Driver: Produce crash diagnostics more often on Windows X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3b5c639f485ad8aa1101a38b58c9f44abae21a19;p=platform%2Fupstream%2Fllvm.git Driver: Produce crash diagnostics more often on Windows Assertion failures call abort(), which return an exit code of 3 on Windows. The 'not' utility has the same check. Unfortunately, the crash-report.c test requires a shell, so it does not run for me locally, so I can only test this manually. There's still more work to be done here: we should generate a batch script instead of a shell script on Windows. llvm-svn: 212481 --- diff --git a/clang/tools/driver/driver.cpp b/clang/tools/driver/driver.cpp index 8993a09..9f93837 100644 --- a/clang/tools/driver/driver.cpp +++ b/clang/tools/driver/driver.cpp @@ -433,8 +433,13 @@ int main(int argc_, const char **argv_) { // If result status is < 0, then the driver command signalled an error. // If result status is 70, then the driver command reported a fatal error. - // In these cases, generate additional diagnostic information if possible. - if (CommandRes < 0 || CommandRes == 70) { + // On Windows, abort will return an exit code of 3. In these cases, + // generate additional diagnostic information if possible. + bool DiagnoseCrash = CommandRes < 0 || CommandRes == 70; +#ifdef LLVM_ON_WIN32 + DiagnoseCrash |= CommandRes == 3; +#endif + if (DiagnoseCrash) { TheDriver.generateCompilationDiagnostics(*C, FailingCommand); break; }