Skip to content

Commit

Permalink
[lto] Disable dialog boxes on crash on Windows.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Bigcheese committed Jan 29, 2015
1 parent 9565549 commit ab9c161
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tools/lto/lto.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit ab9c161

Please sign in to comment.