summaryrefslogtreecommitdiff
path: root/compiler/GHC.hs
diff options
context:
space:
mode:
authorSylvain Henry <sylvain@haskus.fr>2020-05-25 19:20:25 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-07-02 20:08:36 -0400
commitf08d6316d3d19b627550d99b4364e9bf0b45c329 (patch)
tree65e52dcc0b0fc940da95885e7e3e4ca5e585ce49 /compiler/GHC.hs
parent4d90b3ff02002ea25460d087dde56f69a9641096 (diff)
downloadhaskell-f08d6316d3d19b627550d99b4364e9bf0b45c329.tar.gz
Replace Opt_SccProfilingOn flag with sccProfilingEnabled helper function
SCC profiling was enabled in a convoluted way: if WayProf was enabled, Opt_SccProfilingOn general flag was set (in `GHC.Driver.Ways.wayGeneralFlags`), and then this flag was queried in various places. There is no need to go via general flags, so this patch defines a `sccProfilingEnabled :: DynFlags -> Bool` helper function that just checks whether WayProf is enabled.
Diffstat (limited to 'compiler/GHC.hs')
-rw-r--r--compiler/GHC.hs12
1 files changed, 7 insertions, 5 deletions
diff --git a/compiler/GHC.hs b/compiler/GHC.hs
index 4cb2977155..d5d15143c2 100644
--- a/compiler/GHC.hs
+++ b/compiler/GHC.hs
@@ -605,10 +605,12 @@ setSessionDynFlags dflags = do
then do
let
prog = pgm_i dflags ++ flavour
+ profiled = ways dflags `hasWay` WayProf
+ dynamic = ways dflags `hasWay` WayDyn
flavour
- | WayProf `S.member` ways dflags = "-prof"
- | WayDyn `S.member` ways dflags = "-dyn"
- | otherwise = ""
+ | profiled = "-prof" -- FIXME: can't we have both?
+ | dynamic = "-dyn"
+ | otherwise = ""
msg = text "Starting " <> text prog
tr <- if verbosity dflags >= 3
then return (logInfo dflags $ withPprStyle defaultDumpStyle msg)
@@ -617,8 +619,8 @@ setSessionDynFlags dflags = do
conf = IServConfig
{ iservConfProgram = prog
, iservConfOpts = getOpts dflags opt_i
- , iservConfProfiled = gopt Opt_SccProfilingOn dflags
- , iservConfDynamic = WayDyn `S.member` ways dflags
+ , iservConfProfiled = profiled
+ , iservConfDynamic = dynamic
, iservConfHook = createIservProcessHook (hooks dflags)
, iservConfTrace = tr
}