@@ -1172,13 +1172,10 @@ withBootSuffix _ = id
11721172getModSummaryFromImports
11731173 :: HscEnv
11741174 -> FilePath
1175- -> UTCTime
11761175 -> Maybe Util. StringBuffer
11771176 -> ExceptT [FileDiagnostic ] IO ModSummaryResult
1178- -- modTime is only used in GHC < 9.4
1179- getModSummaryFromImports env fp _modTime mContents = do
1180- -- src_hash is only used in GHC >= 9.4
1181- (contents, opts, ppEnv, _src_hash) <- preprocessor env fp mContents
1177+ getModSummaryFromImports env fp mContents = do
1178+ (contents, opts, ppEnv, src_hash) <- preprocessor env fp mContents
11821179
11831180 let dflags = hsc_dflags ppEnv
11841181
@@ -1194,8 +1191,7 @@ getModSummaryFromImports env fp _modTime mContents = do
11941191 (src_idecls, ord_idecls) = partition ((== IsBoot ) . ideclSource. unLoc) imps
11951192
11961193 -- GHC.Prim doesn't exist physically, so don't go looking for it.
1197- -- ghc_prim_imports is only used in GHC >= 9.4
1198- (ordinary_imps, _ghc_prim_imports)
1194+ (ordinary_imps, ghc_prim_imports)
11991195 = partition ((/= moduleName gHC_PRIM) . unLoc
12001196 . ideclName . unLoc)
12011197 ord_idecls
@@ -1233,7 +1229,7 @@ getModSummaryFromImports env fp _modTime mContents = do
12331229 srcImports = rn_imps $ map convImport src_idecls
12341230 textualImports = rn_imps $ map convImport (implicit_imports ++ ordinary_imps)
12351231#endif
1236- ghc_prim_import = not (null _ghc_prim_imports )
1232+ ghc_prim_import = not (null ghc_prim_imports )
12371233
12381234
12391235 -- Force bits that might keep the string buffer and DynFlags alive unnecessarily
@@ -1253,11 +1249,11 @@ getModSummaryFromImports env fp _modTime mContents = do
12531249 ModSummary
12541250 { ms_mod = modl
12551251 , ms_hie_date = Nothing
1256- , ms_dyn_obj_date = Nothing
1252+ , ms_dyn_obj_date = Nothing
12571253#if !MIN_VERSION_ghc(9,13,0)
12581254 , ms_ghc_prim_import = ghc_prim_import
12591255#endif
1260- , ms_hs_hash = _src_hash
1256+ , ms_hs_hash = src_hash
12611257
12621258 , ms_hsc_src = sourceType
12631259 -- The contents are used by the GetModSummary rule
@@ -1539,25 +1535,15 @@ loadInterface session ms linkableNeeded RecompilationInfo{..} = do
15391535 Just ver -> pure $ Just ver
15401536 Nothing -> get_file_version (toNormalizedFilePath' iface_file)
15411537
1542- -- The source is modified if it is newer than the destination (iface file)
1543- -- A more precise check for the core file is performed later
1544- let _sourceMod = case mb_dest_version of -- sourceMod is only used in GHC < 9.4
1545- Nothing -> SourceModified -- destination file doesn't exist, assume modified source
1546- Just dest_version
1547- | source_version <= dest_version -> SourceUnmodified
1548- | otherwise -> SourceModified
1549-
1550- -- old_iface is only used in GHC >= 9.4
1551- _old_iface <- case mb_old_iface of
1538+ old_iface <- case mb_old_iface of
15521539 Just iface -> pure (Just iface)
15531540 Nothing -> do
1554- -- ncu and read_dflags are only used in GHC >= 9.4
1555- let _ncu = hsc_NC sessionWithMsDynFlags
1556- _read_dflags = hsc_dflags sessionWithMsDynFlags
1541+ let ncu = hsc_NC sessionWithMsDynFlags
1542+ read_dflags = hsc_dflags sessionWithMsDynFlags
15571543#if MIN_VERSION_ghc(9,13,0)
1558- read_result <- liftIO $ readIface (hsc_hooks sessionWithMsDynFlags) (hsc_logger sessionWithMsDynFlags) _read_dflags _ncu mod iface_file
1544+ read_result <- liftIO $ readIface (hsc_hooks sessionWithMsDynFlags) (hsc_logger sessionWithMsDynFlags) read_dflags ncu mod iface_file
15591545#else
1560- read_result <- liftIO $ readIface _read_dflags _ncu mod iface_file
1546+ read_result <- liftIO $ readIface read_dflags ncu mod iface_file
15611547#endif
15621548 case read_result of
15631549 Util. Failed {} -> return Nothing
@@ -1568,7 +1554,7 @@ loadInterface session ms linkableNeeded RecompilationInfo{..} = do
15681554 -- If mb_old_iface is nothing then checkOldIface will load it for us
15691555 -- given that the source is unmodified
15701556 (recomp_iface_reqd, mb_checked_iface)
1571- <- liftIO $ checkOldIface sessionWithMsDynFlags ms _old_iface >>= \ case
1557+ <- liftIO $ checkOldIface sessionWithMsDynFlags ms old_iface >>= \ case
15721558 UpToDateItem x -> pure (UpToDate , Just x)
15731559 OutOfDateItem reason x -> pure (NeedsRecompile reason, x)
15741560
0 commit comments