summaryrefslogtreecommitdiff
path: root/compiler/GHC/Driver
diff options
context:
space:
mode:
authorSylvain Henry <sylvain@haskus.fr>2020-03-16 15:44:15 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-04-21 06:39:32 -0400
commitce5c2999d2e356d034fbf1045a2383c0ac24f15f (patch)
tree49116d1a35f39c6c9567d5d281f947037e52f2be /compiler/GHC/Driver
parent35e43d48a9a3ab22da90c4c2ea2c805fe762b9c5 (diff)
downloadhaskell-ce5c2999d2e356d034fbf1045a2383c0ac24f15f.tar.gz
Avoid using sdocWithDynFlags (#17957)
Remove one use of `sdocWithDynFlags` from `GHC.CmmToLlvm.llvmCodeGen'` and from `GHC.Driver.CodeOutput.profilingInitCode`
Diffstat (limited to 'compiler/GHC/Driver')
-rw-r--r--compiler/GHC/Driver/CodeOutput.hs7
-rw-r--r--compiler/GHC/Driver/Main.hs2
2 files changed, 4 insertions, 5 deletions
diff --git a/compiler/GHC/Driver/CodeOutput.hs b/compiler/GHC/Driver/CodeOutput.hs
index f87661846e..3bce0db86d 100644
--- a/compiler/GHC/Driver/CodeOutput.hs
+++ b/compiler/GHC/Driver/CodeOutput.hs
@@ -277,10 +277,9 @@ outputForeignStubs_help fname doc_str header footer
-- module;
-- | Generate code to initialise cost centres
-profilingInitCode :: Module -> CollectedCCs -> SDoc
-profilingInitCode this_mod (local_CCs, singleton_CCSs)
- = sdocWithDynFlags $ \dflags ->
- if not (gopt Opt_SccProfilingOn dflags)
+profilingInitCode :: DynFlags -> Module -> CollectedCCs -> SDoc
+profilingInitCode dflags this_mod (local_CCs, singleton_CCSs)
+ = if not (gopt Opt_SccProfilingOn dflags)
then empty
else vcat
$ map emit_cc_decl local_CCs
diff --git a/compiler/GHC/Driver/Main.hs b/compiler/GHC/Driver/Main.hs
index 2b5dfb2b11..caa18d6670 100644
--- a/compiler/GHC/Driver/Main.hs
+++ b/compiler/GHC/Driver/Main.hs
@@ -1420,7 +1420,7 @@ hscGenHardCode hsc_env cgguts location output_filename = do
let cost_centre_info =
(S.toList local_ccs ++ caf_ccs, caf_cc_stacks)
- prof_init = profilingInitCode this_mod cost_centre_info
+ prof_init = profilingInitCode dflags this_mod cost_centre_info
foreign_stubs = foreign_stubs0 `appendStubC` prof_init
------------------ Code generation ------------------