diff options
author | Matthew Pickering <matthewtpickering@gmail.com> | 2021-04-07 10:57:06 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-04-14 05:07:45 -0400 |
commit | 726da09e76d0832b5aedd5b78624435695ac04e7 (patch) | |
tree | 61c013968fc4a218562a647c1860696ef9ff95a8 /compiler/GHC/Driver/Pipeline/Monad.hs | |
parent | b665d9833b13d9d4241ff56585bbf45d2fcf2278 (diff) | |
download | haskell-726da09e76d0832b5aedd5b78624435695ac04e7.tar.gz |
Always generate ModDetails from ModIface
This vastly reduces memory usage when compiling with `--make` mode, from
about 900M when compiling Cabal to about 300M.
As a matter of uniformity, it also ensures that reading from an
interface performs the same as using the in-memory cache. We can also
delete all the horrible knot-tying in updateIdInfos.
Goes some way to fixing #13586
Accept new output of tests fixing some bugs along the way
-------------------------
Metric Decrease:
T12545
-------------------------
Diffstat (limited to 'compiler/GHC/Driver/Pipeline/Monad.hs')
-rw-r--r-- | compiler/GHC/Driver/Pipeline/Monad.hs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/compiler/GHC/Driver/Pipeline/Monad.hs b/compiler/GHC/Driver/Pipeline/Monad.hs index 4a33543527..d95f9a3973 100644 --- a/compiler/GHC/Driver/Pipeline/Monad.hs +++ b/compiler/GHC/Driver/Pipeline/Monad.hs @@ -27,7 +27,6 @@ import GHC.Utils.TmpFs (TempFileLifetime) import GHC.Types.SourceFile import GHC.Unit.Module -import GHC.Unit.Module.ModDetails import GHC.Unit.Module.ModIface import GHC.Unit.Module.Status @@ -82,7 +81,7 @@ data PipeState = PipeState { -- ^ additional object files resulting from compiling foreign -- code. They come from two sources: foreign stubs, and -- add{C,Cxx,Objc,Objcxx}File from template haskell - iface :: Maybe (ModIface, ModDetails) + iface :: Maybe ModIface -- ^ Interface generated by HscOut phase. Only available after the -- phase runs. } @@ -90,7 +89,7 @@ data PipeState = PipeState { pipeStateDynFlags :: PipeState -> DynFlags pipeStateDynFlags = hsc_dflags . hsc_env -pipeStateModIface :: PipeState -> Maybe (ModIface, ModDetails) +pipeStateModIface :: PipeState -> Maybe ModIface pipeStateModIface = iface data PipelineOutput @@ -139,5 +138,5 @@ setForeignOs :: [FilePath] -> CompPipeline () setForeignOs os = P $ \_env state -> return (state{ foreign_os = os }, ()) -setIface :: ModIface -> ModDetails -> CompPipeline () -setIface iface details = P $ \_env state -> return (state{ iface = Just (iface, details) }, ()) +setIface :: ModIface -> CompPipeline () +setIface iface = P $ \_env state -> return (state{ iface = Just iface }, ()) |