diff options
author | Alexandre Ganea <alexandre.ganea@ubisoft.com> | 2020-02-11 10:17:15 -0500 |
---|---|---|
committer | Alexandre Ganea <alexandre.ganea@ubisoft.com> | 2020-02-11 10:17:30 -0500 |
commit | faace365088a2a3a4cb1050a9facfc34a7a56577 (patch) | |
tree | beedb5b9a4ec30d44d2fd6148f65a9f715a51fda /clang/tools/driver/cc1_main.cpp | |
parent | 9a3740c33919287fd9aa4e0c6f761619e84c62a7 (diff) | |
download | llvm-faace365088a2a3a4cb1050a9facfc34a7a56577.zip llvm-faace365088a2a3a4cb1050a9facfc34a7a56577.tar.gz llvm-faace365088a2a3a4cb1050a9facfc34a7a56577.tar.bz2 |
[Clang][Driver] After default -fintegrated-cc1, make llvm::report_fatal_error() generate preprocessed source + reproducer.sh again.
Added a test for #pragma clang __debug llvm_fatal_error to test for the original issue.
Added llvm::sys::Process::Exit() and replaced ::exit() in places where it was appropriate. This new function would call the current CrashRecoveryContext if one is running on the same thread; or call ::exit() otherwise.
Fixes PR44705.
Differential Revision: https://reviews.llvm.org/D73742
Diffstat (limited to 'clang/tools/driver/cc1_main.cpp')
-rw-r--r-- | clang/tools/driver/cc1_main.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/tools/driver/cc1_main.cpp b/clang/tools/driver/cc1_main.cpp index b551e9f..6d1a67f 100644 --- a/clang/tools/driver/cc1_main.cpp +++ b/clang/tools/driver/cc1_main.cpp @@ -36,6 +36,7 @@ #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/ManagedStatic.h" #include "llvm/Support/Path.h" +#include "llvm/Support/Process.h" #include "llvm/Support/Signals.h" #include "llvm/Support/TargetRegistry.h" #include "llvm/Support/TargetSelect.h" @@ -69,7 +70,7 @@ static void LLVMErrorHandler(void *UserData, const std::string &Message, // We cannot recover from llvm errors. When reporting a fatal error, exit // with status 70 to generate crash diagnostics. For BSD systems this is // defined as an internal software error. Otherwise, exit with status 1. - exit(GenCrashDiag ? 70 : 1); + llvm::sys::Process::Exit(GenCrashDiag ? 70 : 1); } #ifdef CLANG_HAVE_RLIMITS |