Skip to content

Commit e1eff1b

Browse files
committed
Windows: Disable LLVM crash dialog boxes.
1 parent 21b4a9c commit e1eff1b

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

compiler/rustc_codegen_llvm/src/llvm/ffi.rs

+1
Original file line numberDiff line numberDiff line change
@@ -987,6 +987,7 @@ pub type SelfProfileAfterPassCallback = unsafe extern "C" fn(*mut c_void);
987987

988988
extern "C" {
989989
pub fn LLVMRustInstallFatalErrorHandler();
990+
pub fn LLVMRustDisableSystemDialogsOnCrash();
990991

991992
// Create and destroy contexts.
992993
pub fn LLVMRustContextCreate(shouldDiscardNames: bool) -> &'static mut Context;

compiler/rustc_codegen_llvm/src/llvm_util.rs

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ unsafe fn configure_llvm(sess: &Session) {
4646
let mut llvm_args = Vec::with_capacity(n_args + 1);
4747

4848
llvm::LLVMRustInstallFatalErrorHandler();
49+
llvm::LLVMRustDisableSystemDialogsOnCrash();
4950

5051
fn llvm_arg_to_arg_name(full_arg: &str) -> &str {
5152
full_arg.trim().split(|c: char| c == '=' || c.is_whitespace()).next().unwrap_or("")

compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@ extern "C" void LLVMRustInstallFatalErrorHandler() {
7676
install_fatal_error_handler(FatalErrorHandler);
7777
}
7878

79+
extern "C" void LLVMRustDisableSystemDialogsOnCrash() {
80+
sys::DisableSystemDialogsOnCrash();
81+
}
82+
7983
extern "C" char *LLVMRustGetLastError(void) {
8084
char *Ret = LastError;
8185
LastError = nullptr;

0 commit comments

Comments
 (0)