[lto] Disable dialog boxes on crash on Windows.
authorMichael J. Spencer <bigcheesegs@gmail.com>
Thu, 29 Jan 2015 17:20:41 +0000 (17:20 +0000)
committerMichael J. Spencer <bigcheesegs@gmail.com>
Thu, 29 Jan 2015 17:20:41 +0000 (17:20 +0000)
This has to be done in the DLL because the state doesn't cross DLL boundaries.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227471 91177308-0d34-0410-b5e6-96231b3b80d8

tools/lto/lto.cpp

index ec0372ea56076e626f198f6c5162fde6b6a6cad2..74e0dbe5e377e0b09562b3d4ed3eea030425e7d5 100644 (file)
@@ -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();