diff options
author | NAKAMURA Takumi <geek4civic@gmail.com> | 2011-11-29 07:47:04 +0000 |
---|---|---|
committer | NAKAMURA Takumi <geek4civic@gmail.com> | 2011-11-29 07:47:04 +0000 |
commit | 64404a3b2c62db01c3a4459a2c15c37496ed9f65 (patch) | |
tree | 0664df2b6417bce6b732ed39710270acc70c0f26 /clang/lib/Driver/Driver.cpp | |
parent | 0e5bae71917ad2f66b57c5adcfea3cb083a7b986 (diff) | |
download | bcm5719-llvm-64404a3b2c62db01c3a4459a2c15c37496ed9f65.tar.gz bcm5719-llvm-64404a3b2c62db01c3a4459a2c15c37496ed9f65.zip |
[Win32] Catch exceptions (eg. segfault) on waiting for invoked clang from the driver.
clang/lib/Driver/Driver.cpp: Don't pass through negative exit status, or parent would be confused.
llvm::sys::Program::Wait(): Suppose 0x8000XXXX and 0xC000XXXX as abnormal exit code and pass it as negative value.
Win32 Exception Handler: Exit with ExceptionCode on an unhandle exception.
llvm-svn: 145389
Diffstat (limited to 'clang/lib/Driver/Driver.cpp')
-rw-r--r-- | clang/lib/Driver/Driver.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp index 086e3a411f3..ec344e0c788 100644 --- a/clang/lib/Driver/Driver.cpp +++ b/clang/lib/Driver/Driver.cpp @@ -511,8 +511,14 @@ int Driver::ExecuteCompilation(const Compilation &C, C.CleanupFileList(C.getResultFiles(), true); // Failure result files are valid unless we crashed. - if (Res < 0) + if (Res < 0) { C.CleanupFileList(C.getFailureResultFiles(), true); +#ifdef _WIN32 + // Exit status should not be negative on Win32, + // unless abnormal termination. + Res = 1; +#endif + } } // Print extra information about abnormal failures, if possible. |