[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
This commit is contained in:
Michael J. Spencer 2015-01-29 17:20:41 +00:00
parent 89b0ad2647
commit 50a20c0e42
1 changed files with 7 additions and 0 deletions

View 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();