diff options
author | Josh Meredith <joshmeredith2008@gmail.com> | 2019-12-04 23:39:28 +1100 |
---|---|---|
committer | Josh Meredith <joshmeredith2008@gmail.com> | 2019-12-04 23:39:28 +1100 |
commit | a8435165b84c32fd2ebdd1281dd6ee077e07ad5a (patch) | |
tree | 791936d014aeaa26174c2dcbef34c14f3329dd04 /compiler/main/HscMain.hs | |
parent | 7805441b4d5e22eb63a501e1e40383d10380dc92 (diff) | |
parent | f03a41d4bf9418ee028ecb51654c928b2da74edd (diff) | |
download | haskell-wip/binary-readerT.tar.gz |
Merge branch 'master' into wip/binary-readerTwip/binary-readerT
Diffstat (limited to 'compiler/main/HscMain.hs')
-rw-r--r-- | compiler/main/HscMain.hs | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/compiler/main/HscMain.hs b/compiler/main/HscMain.hs index 3d2ac983a4..9daecdb550 100644 --- a/compiler/main/HscMain.hs +++ b/compiler/main/HscMain.hs @@ -727,7 +727,7 @@ hscIncrementalCompile :: Bool -> SourceModified -> Maybe ModIface -> (Int,Int) - -> IO (HscStatus, ModDetails, DynFlags) + -> IO (HscStatus, DynFlags) hscIncrementalCompile always_do_basic_recompilation_check m_tc_result mHscMessage hsc_env' mod_summary source_modified mb_old_iface mod_index = do @@ -768,14 +768,14 @@ hscIncrementalCompile always_do_basic_recompilation_check m_tc_result -- in make mode, since this HMI will go into the HPT. details <- genModDetails hsc_env' iface return details - return (HscUpToDate iface, details, dflags) + return (HscUpToDate iface details, dflags) -- We finished type checking. (mb_old_hash is the hash of -- the interface that existed on disk; it's possible we had -- to retypecheck but the resulting interface is exactly -- the same.) Right (FrontendTypecheck tc_result, mb_old_hash) -> do - (status, mb_old_hash) <- finish mod_summary tc_result mb_old_hash - return (status, mb_old_hash, dflags) + status <- finish mod_summary tc_result mb_old_hash + return (status, dflags) -- Runs the post-typechecking frontend (desugar and simplify). We want to -- generate most of the interface as late as possible. This gets us up-to-date @@ -792,7 +792,7 @@ hscIncrementalCompile always_do_basic_recompilation_check m_tc_result finish :: ModSummary -> TcGblEnv -> Maybe Fingerprint - -> Hsc (HscStatus, ModDetails) + -> Hsc HscStatus finish summary tc_result mb_old_hash = do hsc_env <- getHscEnv let dflags = hsc_dflags hsc_env @@ -800,20 +800,18 @@ finish summary tc_result mb_old_hash = do hsc_src = ms_hsc_src summary should_desugar = ms_mod summary /= gHC_PRIM && hsc_src == HsSrcFile - mk_simple_iface :: Hsc (HscStatus, ModDetails) + mk_simple_iface :: Hsc HscStatus mk_simple_iface = do (iface, mb_old_iface_hash, details) <- liftIO $ hscSimpleIface hsc_env tc_result mb_old_hash liftIO $ hscMaybeWriteIface dflags iface mb_old_iface_hash (ms_location summary) - let hsc_status = - case (target, hsc_src) of - (HscNothing, _) -> HscNotGeneratingCode iface - (_, HsBootFile) -> HscUpdateBoot iface - (_, HsigFile) -> HscUpdateSig iface - _ -> panic "finish" - return (hsc_status, details) + return $ case (target, hsc_src) of + (HscNothing, _) -> HscNotGeneratingCode iface details + (_, HsBootFile) -> HscUpdateBoot iface details + (_, HsigFile) -> HscUpdateSig iface details + _ -> panic "finish" if should_desugar then do @@ -839,12 +837,12 @@ finish summary tc_result mb_old_hash = do -- See Note [Avoiding space leaks in toIface*] for details. force (mkPartialIface hsc_env details desugared_guts) - return ( HscRecomp { hscs_guts = cg_guts, - hscs_mod_location = ms_location summary, - hscs_partial_iface = partial_iface, - hscs_old_iface_hash = mb_old_hash, - hscs_iface_dflags = dflags }, - details ) + return HscRecomp { hscs_guts = cg_guts, + hscs_mod_location = ms_location summary, + hscs_mod_details = details, + hscs_partial_iface = partial_iface, + hscs_old_iface_hash = mb_old_hash, + hscs_iface_dflags = dflags } else mk_simple_iface |