diff options
author | Sylvain Henry <sylvain@haskus.fr> | 2017-02-02 14:37:24 -0500 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2017-02-02 22:13:53 -0500 |
commit | bbd3c399939311ec3e308721ab87ca6b9443f358 (patch) | |
tree | 1a398f3857502ab42f350008f83b7c67f0d9ff1e /compiler/main/GHC.hs | |
parent | 6128b2ffbe36ed2779583e05ee9d817eaafc1c9c (diff) | |
download | haskell-bbd3c399939311ec3e308721ab87ca6b9443f358.tar.gz |
Ditch static flags
This patch converts the 4 lasting static flags (read from the command
line and unsafely stored in immutable global variables) into dynamic
flags. Most use cases have been converted into reading them from a DynFlags.
In cases for which we don't have easy access to a DynFlags, we read from
'unsafeGlobalDynFlags' that is set at the beginning of each 'runGhc'.
It's not perfect (not thread-safe) but it is still better as we can
set/unset these 4 flags before each run when using GHC API.
Updates haddock submodule.
Rebased and finished by: bgamari
Test Plan: validate
Reviewers: goldfire, erikd, hvr, austin, simonmar, bgamari
Reviewed By: simonmar
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2839
GHC Trac Issues: #8440
Diffstat (limited to 'compiler/main/GHC.hs')
-rw-r--r-- | compiler/main/GHC.hs | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/compiler/main/GHC.hs b/compiler/main/GHC.hs index bc406d5c59..f8f3ba9678 100644 --- a/compiler/main/GHC.hs +++ b/compiler/main/GHC.hs @@ -31,7 +31,6 @@ module GHC ( getSessionDynFlags, setSessionDynFlags, getProgramDynFlags, setProgramDynFlags, getInteractiveDynFlags, setInteractiveDynFlags, - parseStaticFlags, -- * Targets Target(..), TargetId(..), Phase, @@ -276,7 +275,6 @@ module GHC ( ToDo: * inline bits of HscMain here to simplify layering: hscTcExpr, hscStmt. - * what StaticFlags should we expose, if any? -} #include "HsVersions.h" @@ -317,7 +315,6 @@ import DriverPhases ( Phase(..), isHaskellSrcFilename ) import Finder import HscTypes import DynFlags -import StaticFlags import SysTools import Annotations import Module @@ -479,8 +476,7 @@ withCleanupSession ghc = ghc `gfinally` cleanup initGhcMonad :: GhcMonad m => Maybe FilePath -> m () initGhcMonad mb_top_dir = do { env <- liftIO $ - do { initStaticOpts - ; mySettings <- initSysTools mb_top_dir + do { mySettings <- initSysTools mb_top_dir ; dflags <- initDynFlags (defaultDynFlags mySettings) ; checkBrokenTablesNextToCode dflags ; setUnsafeGlobalDynFlags dflags |