@@ -110,27 +110,17 @@ import System.IO.Extra (fixIO, newTempFileWithin)
110110
111111import GHC.Tc.Gen.Splice
112112
113- #if !MIN_VERSION_ghc(9,2,1)
114- import GHC.Driver.Types
115- #endif
116113
117- #if !MIN_VERSION_ghc(9,2,0)
118- import qualified Data.IntMap.Strict as IntMap
119- #endif
120114
121- #if MIN_VERSION_ghc(9,2,0)
122115import qualified GHC as G
123- #endif
124116
125- #if MIN_VERSION_ghc(9,2,0) && !MIN_VERSION_ghc(9,3,0)
117+ #if !MIN_VERSION_ghc(9,3,0)
126118import GHC (ModuleGraph )
127119#endif
128120
129- #if MIN_VERSION_ghc(9,2,1)
130121import GHC.Types.ForeignStubs
131122import GHC.Types.HpcInfo
132123import GHC.Types.TypeEnv
133- #endif
134124
135125#if !MIN_VERSION_ghc(9,3,0)
136126import Data.Map (Map )
@@ -265,7 +255,6 @@ captureSplicesAndDeps TypecheckHelpers{..} env k = do
265255 ; lintInteractiveExpr " hscCompileExpr" hsc_env prepd_expr
266256
267257
268- #if MIN_VERSION_ghc(9,2,0)
269258 ; let iNTERACTIVELoc = G. ModLocation { ml_hs_file = Nothing ,
270259 ml_hi_file = panic " hscCompileCoreExpr':ml_hi_file" ,
271260 ml_obj_file = panic " hscCompileCoreExpr':ml_obj_file" ,
@@ -293,11 +282,6 @@ captureSplicesAndDeps TypecheckHelpers{..} env k = do
293282 (icInteractiveModule ictxt)
294283 stg_expr
295284 [] Nothing
296- #else
297- {- Convert to BCOs -}
298- ; bcos <- coreExprToBCOs hsc_env
299- (icInteractiveModule (hsc_IC hsc_env)) prepd_expr
300- #endif
301285
302286 -- Exclude wired-in names because we may not have read
303287 -- their interface files, so getLinkDeps will fail
@@ -312,11 +296,7 @@ captureSplicesAndDeps TypecheckHelpers{..} env k = do
312296 moduleName mod -- On <= 9.2, just the name is enough because all unit ids will be the same
313297#endif
314298
315- #if MIN_VERSION_ghc(9,2,0)
316299 | n <- concatMap (uniqDSetToList . bcoFreeNames) $ bc_bcos bcos
317- #else
318- | n <- uniqDSetToList (bcoFreeNames bcos)
319- #endif
320300 , Just mod <- [nameModule_maybe n] -- Names from other modules
321301 , not (isWiredInName n) -- Exclude wired-in names
322302 , moduleUnitId mod `elem` home_unit_ids -- Only care about stuff from the home package set
@@ -357,13 +337,10 @@ captureSplicesAndDeps TypecheckHelpers{..} env k = do
357337 {- load it -}
358338 ; (fv_hvs, lbss, pkgs) <- loadDecls (hscInterp hsc_env') hsc_env' srcspan bcos
359339 ; let hval = ((expectJust " hscCompileCoreExpr'" $ lookup (idName binding_id) fv_hvs), lbss, pkgs)
360- #elif MIN_VERSION_ghc(9,2,0)
340+ #else
361341 {- load it -}
362342 ; fv_hvs <- loadDecls (hscInterp hsc_env') hsc_env' srcspan bcos
363343 ; let hval = (expectJust " hscCompileCoreExpr'" $ lookup (idName binding_id) fv_hvs)
364- #else
365- {- link it -}
366- ; hval <- linkExpr hsc_env' srcspan bcos
367344#endif
368345
369346 ; modifyIORef' var (flip extendModuleEnvList [(mi_module $ hm_iface hm, linkableHash lb) | lb <- lbs, let hm = linkableHomeMod lb])
@@ -881,7 +858,7 @@ generateHieAsts hscEnv tcm =
881858 where
882859 dflags = hsc_dflags hscEnv
883860 run _ts = -- ts is only used in GHC 9.2
884- #if MIN_VERSION_ghc(9,2,0) && !MIN_VERSION_ghc(9,3,0)
861+ #if !MIN_VERSION_ghc(9,3,0)
885862 fmap (join . snd ) . liftIO . initDs hscEnv _ts
886863#else
887864 id
@@ -1189,15 +1166,15 @@ getModSummaryFromImports env fp _modTime mContents = do
11891166
11901167
11911168 convImport (L _ i) = (
1192- #if !MIN_VERSION_ghc (9,3,0)
1169+ #if !MIN_VERSION_ghc(9,3,0)
11931170 fmap sl_fs
11941171#endif
11951172 (ideclPkgQual i)
11961173 , reLoc $ ideclName i)
11971174
11981175 msrImports = implicit_imports ++ imps
11991176
1200- #if MIN_VERSION_ghc (9,3,0)
1177+ #if MIN_VERSION_ghc(9,3,0)
12011178 rn_pkg_qual = renameRawPkgQual (hsc_unit_env ppEnv)
12021179 rn_imps = fmap (\ (pk, lmn@ (L _ mn)) -> (rn_pkg_qual mn pk, lmn))
12031180 srcImports = rn_imps $ map convImport src_idecls
@@ -1714,9 +1691,6 @@ getDocsBatch hsc_env _names = do
17141691#else
17151692 Map. lookup name dmap ,
17161693#endif
1717- #if !MIN_VERSION_ghc(9,2,0)
1718- IntMap. fromAscList $ Map. toAscList $
1719- #endif
17201694#if MIN_VERSION_ghc(9,3,0)
17211695 lookupWithDefaultUniqMap amap mempty name))
17221696#else
@@ -1739,12 +1713,7 @@ lookupName :: HscEnv
17391713lookupName _ name
17401714 | Nothing <- nameModule_maybe name = pure Nothing
17411715lookupName hsc_env name = exceptionHandle $ do
1742- #if MIN_VERSION_ghc(9,2,0)
17431716 mb_thing <- liftIO $ lookupType hsc_env name
1744- #else
1745- eps <- liftIO $ readIORef (hsc_EPS hsc_env)
1746- let mb_thing = lookupType (hsc_dflags hsc_env) (hsc_HPT hsc_env) (eps_PTE eps) name
1747- #endif
17481717 case mb_thing of
17491718 x@ (Just _) -> return x
17501719 Nothing
0 commit comments