diff options
author | Ömer Sinan Ağacan <omeragacan@gmail.com> | 2019-11-26 10:45:45 +0300 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2019-11-29 08:25:28 -0500 |
commit | 7f695a20f5f9fe4952ca8cde45d73f3604a7cc29 (patch) | |
tree | 057027123853d3ff52c771c1671f8f150e18cd74 /compiler/main/PipelineMonad.hs | |
parent | 6985e0fc4f6fb30c1effd356d87c1a0629aa9cd0 (diff) | |
download | haskell-7f695a20f5f9fe4952ca8cde45d73f3604a7cc29.tar.gz |
Pass ModDetails with (partial) ModIface in HscStatus
(Partial) ModIface and ModDetails are generated at the same time, but
they're passed differently: ModIface is passed in HscStatus consturctors
while ModDetails is returned in a tuple. This refactors ModDetails
passing so that it's passed around with ModIface in HscStatus
constructors. This makes the code more consistent and hopefully easier
to understand: ModIface and ModDetails are really very closely related.
It makes sense to treat them the same way.
Diffstat (limited to 'compiler/main/PipelineMonad.hs')
-rw-r--r-- | compiler/main/PipelineMonad.hs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/main/PipelineMonad.hs b/compiler/main/PipelineMonad.hs index bdda19ceac..a3608ac4cd 100644 --- a/compiler/main/PipelineMonad.hs +++ b/compiler/main/PipelineMonad.hs @@ -72,7 +72,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 + iface :: Maybe (ModIface, ModDetails) -- ^ Interface generated by HscOut phase. Only available after the -- phase runs. } @@ -80,7 +80,7 @@ data PipeState = PipeState { pipeStateDynFlags :: PipeState -> DynFlags pipeStateDynFlags = hsc_dflags . hsc_env -pipeStateModIface :: PipeState -> Maybe ModIface +pipeStateModIface :: PipeState -> Maybe (ModIface, ModDetails) pipeStateModIface = iface data PipelineOutput @@ -118,5 +118,5 @@ setForeignOs :: [FilePath] -> CompPipeline () setForeignOs os = P $ \_env state -> return (state{ foreign_os = os }, ()) -setIface :: ModIface -> CompPipeline () -setIface iface = P $ \_env state -> return (state{ iface = Just iface }, ()) +setIface :: ModIface -> ModDetails -> CompPipeline () +setIface iface details = P $ \_env state -> return (state{ iface = Just (iface, details) }, ()) |