From cd35d70f46c96a0274231e27c7ed919a376e4a6f Mon Sep 17 00:00:00 2001 From: "Michael J. Spencer" Date: Thu, 29 Jan 2015 17:20:41 +0000 Subject: [PATCH] [lto] Disable dialog boxes on crash on Windows. This has to be done in the DLL because the state doesn't cross DLL boundaries. llvm-svn: 227471 --- tools/lto/lto.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tools/lto/lto.cpp b/tools/lto/lto.cpp index ec0372ea560..74e0dbe5e37 100644 --- a/tools/lto/lto.cpp +++ b/tools/lto/lto.cpp @@ -18,6 +18,7 @@ #include "llvm/LTO/LTOCodeGenerator.h" #include "llvm/LTO/LTOModule.h" #include "llvm/Support/MemoryBuffer.h" +#include "llvm/Support/Signals.h" #include "llvm/Support/TargetSelect.h" // extra command-line flags needed for LTOCodeGenerator @@ -51,6 +52,12 @@ static bool parsedOptions = false; // Initialize the configured targets if they have not been initialized. static void lto_initialize() { if (!initialized) { +#ifdef LLVM_ON_WIN32 + // Dialog box on crash disabling doesn't work across DLL boundaries, so do + // it here. + llvm::sys::DisableSystemDialogsOnCrash(); +#endif + InitializeAllTargetInfos(); InitializeAllTargets(); InitializeAllTargetMCs();