diff options
author | Sylvain Henry <sylvain@haskus.fr> | 2020-05-25 19:20:25 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-07-02 20:08:36 -0400 |
commit | f08d6316d3d19b627550d99b4364e9bf0b45c329 (patch) | |
tree | 65e52dcc0b0fc940da95885e7e3e4ca5e585ce49 /compiler/GHC/Driver/Session.hs | |
parent | 4d90b3ff02002ea25460d087dde56f69a9641096 (diff) | |
download | haskell-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/Driver/Session.hs')
-rw-r--r-- | compiler/GHC/Driver/Session.hs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler/GHC/Driver/Session.hs b/compiler/GHC/Driver/Session.hs index 0a45d96621..85eca17aed 100644 --- a/compiler/GHC/Driver/Session.hs +++ b/compiler/GHC/Driver/Session.hs @@ -42,6 +42,7 @@ module GHC.Driver.Session ( whenCannotGenerateDynamicToo, dynamicTooMkDynamicDynFlags, dynamicOutputFile, + sccProfilingEnabled, DynFlags(..), FlagSpec(..), HasDynFlags(..), ContainsDynFlags(..), @@ -5094,6 +5095,10 @@ isBmi2Enabled dflags = case platformArch (targetPlatform dflags) of ArchX86 -> bmiVersion dflags >= Just BMI2 _ -> False +-- | Indicate if cost-centre profiling is enabled +sccProfilingEnabled :: DynFlags -> Bool +sccProfilingEnabled dflags = ways dflags `hasWay` WayProf + -- ----------------------------------------------------------------------------- -- Linker/compiler information |