summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSylvain Henry <sylvain@haskus.fr>2020-09-07 11:36:40 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-09-07 21:19:20 -0400
commitdf04b81e12dac85292aa18c07e6afac7a8bd2fd5 (patch)
tree2bb09835daa4b20307764e49c88c024d7c86b1d3
parent4ff93292243888545da452ea4d4c1987f2343591 (diff)
downloadhaskell-df04b81e12dac85292aa18c07e6afac7a8bd2fd5.tar.gz
Move DynFlags test into updateModDetailsIdInfos's caller (#17957)
-rw-r--r--compiler/GHC/Driver/Pipeline.hs7
-rw-r--r--compiler/GHC/Iface/UpdateIdInfos.hs10
2 files changed, 7 insertions, 10 deletions
diff --git a/compiler/GHC/Driver/Pipeline.hs b/compiler/GHC/Driver/Pipeline.hs
index 7276762f0f..79d2411bba 100644
--- a/compiler/GHC/Driver/Pipeline.hs
+++ b/compiler/GHC/Driver/Pipeline.hs
@@ -1237,8 +1237,11 @@ runPhase (HscOut src_flavour mod_name result) _ dflags = do
hscGenHardCode hsc_env' cgguts mod_location output_fn
final_iface <- liftIO (mkFullIface hsc_env'{hsc_dflags=iface_dflags} partial_iface (Just cg_infos))
- let final_mod_details = {-# SCC updateModDetailsIdInfos #-}
- updateModDetailsIdInfos iface_dflags cg_infos mod_details
+ let final_mod_details
+ | gopt Opt_OmitInterfacePragmas iface_dflags
+ = mod_details
+ | otherwise = {-# SCC updateModDetailsIdInfos #-}
+ updateModDetailsIdInfos cg_infos mod_details
setIface final_iface final_mod_details
-- See Note [Writing interface files]
diff --git a/compiler/GHC/Iface/UpdateIdInfos.hs b/compiler/GHC/Iface/UpdateIdInfos.hs
index 9079bcae56..fcc93c110e 100644
--- a/compiler/GHC/Iface/UpdateIdInfos.hs
+++ b/compiler/GHC/Iface/UpdateIdInfos.hs
@@ -8,7 +8,6 @@ import GHC.Prelude
import GHC.Core
import GHC.Core.InstEnv
-import GHC.Driver.Session
import GHC.Driver.Types
import GHC.StgToCmm.Types (CgInfos (..))
import GHC.Types.Id
@@ -28,16 +27,11 @@ import GHC.Utils.Panic
-- See Note [Conveying CAF-info and LFInfo between modules] in
-- GHC.StgToCmm.Types.
updateModDetailsIdInfos
- :: DynFlags
- -> CgInfos
+ :: CgInfos
-> ModDetails -- ^ ModDetails to update
-> ModDetails
-updateModDetailsIdInfos dflags _ mod_details
- | gopt Opt_OmitInterfacePragmas dflags
- = mod_details
-
-updateModDetailsIdInfos _ cg_infos mod_details =
+updateModDetailsIdInfos cg_infos mod_details =
let
ModDetails{ md_types = type_env -- for unfoldings
, md_insts = insts