[Git][ghc/ghc][master] Move DynFlags test into updateModDetailsIdInfos's caller (#17957)

Marge Bot gitlab at gitlab.haskell.org
Tue Sep 8 01:19:26 UTC 2020



 Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC


Commits:
df04b81e by Sylvain Henry at 2020-09-07T21:19:20-04:00
Move DynFlags test into updateModDetailsIdInfos's caller (#17957)

- - - - -


2 changed files:

- compiler/GHC/Driver/Pipeline.hs
- compiler/GHC/Iface/UpdateIdInfos.hs


Changes:

=====================================
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]


=====================================
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



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/df04b81e12dac85292aa18c07e6afac7a8bd2fd5

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/df04b81e12dac85292aa18c07e6afac7a8bd2fd5
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20200907/f6ac046f/attachment-0001.html>


More information about the ghc-commits mailing list