Windows: Disable LLVM crash dialog boxes.

This commit is contained in:
Eric Huss 2022-01-27 16:53:17 -08:00
parent 21b4a9cfdc
commit e1eff1b0e8
3 changed files with 6 additions and 0 deletions

View file

@ -987,6 +987,7 @@ pub type SelfProfileAfterPassCallback = unsafe extern "C" fn(*mut c_void);
extern "C" {
pub fn LLVMRustInstallFatalErrorHandler();
pub fn LLVMRustDisableSystemDialogsOnCrash();
// Create and destroy contexts.
pub fn LLVMRustContextCreate(shouldDiscardNames: bool) -> &'static mut Context;

View file

@ -46,6 +46,7 @@ unsafe fn configure_llvm(sess: &Session) {
let mut llvm_args = Vec::with_capacity(n_args + 1);
llvm::LLVMRustInstallFatalErrorHandler();
llvm::LLVMRustDisableSystemDialogsOnCrash();
fn llvm_arg_to_arg_name(full_arg: &str) -> &str {
full_arg.trim().split(|c: char| c == '=' || c.is_whitespace()).next().unwrap_or("")

View file

@ -76,6 +76,10 @@ extern "C" void LLVMRustInstallFatalErrorHandler() {
install_fatal_error_handler(FatalErrorHandler);
}
extern "C" void LLVMRustDisableSystemDialogsOnCrash() {
sys::DisableSystemDialogsOnCrash();
}
extern "C" char *LLVMRustGetLastError(void) {
char *Ret = LastError;
LastError = nullptr;