diff options
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/main/GHC.hs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/compiler/main/GHC.hs b/compiler/main/GHC.hs index 9dc68537d9..6a3887a0e9 100644 --- a/compiler/main/GHC.hs +++ b/compiler/main/GHC.hs @@ -13,6 +13,8 @@ module GHC ( defaultErrorHandler, defaultCleanupHandler, prettyPrintGhcErrors, + installSignalHandlers, + withCleanupSession, -- * GHC Monad Ghc, GhcT, GhcMonad(..), HscEnv, @@ -437,6 +439,7 @@ runGhc mb_top_dir ghc = do ref <- newIORef (panic "empty session") let session = Session ref flip unGhc session $ do + liftIO installSignalHandlers -- catch ^C initGhcMonad mb_top_dir withCleanupSession ghc @@ -456,6 +459,7 @@ runGhcT mb_top_dir ghct = do ref <- liftIO $ newIORef (panic "empty session") let session = Session ref flip unGhcT session $ do + liftIO installSignalHandlers -- catch ^C initGhcMonad mb_top_dir withCleanupSession ghct @@ -490,8 +494,7 @@ withCleanupSession ghc = ghc `gfinally` cleanup initGhcMonad :: GhcMonad m => Maybe FilePath -> m () initGhcMonad mb_top_dir = do { env <- liftIO $ - do { installSignalHandlers -- catch ^C - ; initStaticOpts + do { initStaticOpts ; mySettings <- initSysTools mb_top_dir ; dflags <- initDynFlags (defaultDynFlags mySettings) ; checkBrokenTablesNextToCode dflags |