summaryrefslogtreecommitdiff
path: root/ghc
diff options
context:
space:
mode:
authorSylvain Henry <sylvain@haskus.fr>2020-03-05 11:17:46 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-03-11 20:33:37 -0400
commit8e6febcee4b91a88a5027baac4bee5a8847fe79b (patch)
tree52e17447417df5f410ea4e571ea5df7ead752bb8 /ghc
parent3aa9b35fcc417ab39d8da633482fe64dc9f898b1 (diff)
downloadhaskell-8e6febcee4b91a88a5027baac4bee5a8847fe79b.tar.gz
Refactor GHC.Driver.Session (Ways and Flags)
* extract flags and ways into their own modules (with some renaming) * remove one SOURCE import of GHC.Driver.Session from GHC.Driver.Phases * when GHC uses dynamic linking (WayDyn), `interpWays` was only reporting WayDyn even if the host was profiled (WayProf). Now it returns both as expected (might fix #16803). * `mkBuildTag :: [Way] -> String` wasn't reporting a canonical tag for differently ordered lists. Now we sort and nub the list to fix this.
Diffstat (limited to 'ghc')
-rw-r--r--ghc/Main.hs9
1 files changed, 5 insertions, 4 deletions
diff --git a/ghc/Main.hs b/ghc/Main.hs
index ab5c3323cc..4c546b3afc 100644
--- a/ghc/Main.hs
+++ b/ghc/Main.hs
@@ -28,6 +28,7 @@ import GHC.Driver.Main ( newHscEnv )
import GHC.Driver.Pipeline ( oneShot, compileFile )
import GHC.Driver.MakeFile ( doMkDependHS )
import GHC.Driver.Backpack ( doBackpack )
+import GHC.Driver.Ways
#if defined(HAVE_INTERNAL_INTERPRETER)
import GHCi.UI ( interactiveUI, ghciWelcomeMsg, defaultGhciSettings )
#endif
@@ -197,13 +198,13 @@ main' postLoadMode dflags0 args flagWarnings = do
let dflags4 = case lang of
HscInterpreted | not (gopt Opt_ExternalInterpreter dflags3) ->
let platform = targetPlatform dflags3
- dflags3a = updateWays $ dflags3 { ways = interpWays }
+ dflags3a = updateWays $ dflags3 { ways = hostFullWays }
dflags3b = foldl gopt_set dflags3a
$ concatMap (wayGeneralFlags platform)
- interpWays
+ hostFullWays
dflags3c = foldl gopt_unset dflags3b
$ concatMap (wayUnsetGeneralFlags platform)
- interpWays
+ hostFullWays
in dflags3c
_ ->
dflags3
@@ -353,7 +354,7 @@ checkOptions mode dflags srcs objs = do
hPutStrLn stderr ("Warning: -debug, -threaded and -ticky are ignored by GHCi")
-- -prof and --interactive are not a good combination
- when ((filter (not . wayRTSOnly) (ways dflags) /= interpWays)
+ when ((filter (not . wayRTSOnly) (ways dflags) /= hostFullWays)
&& isInterpretiveMode mode
&& not (gopt Opt_ExternalInterpreter dflags)) $
do throwGhcException (UsageError