@@ -124,6 +124,10 @@ import GHC.Types.Error (errMsgDiagnostic,
124124 singleMessage )
125125import GHC.Unit.State
126126
127+ #if MIN_VERSION_ghc(9,13,0)
128+ import GHC.Driver.Make (checkHomeUnitsClosed )
129+ #endif
130+
127131data Log
128132 = LogSettingInitialDynFlags
129133 | LogGetInitialGhcLibDirDefaultCradleFail ! CradleError ! FilePath ! (Maybe FilePath ) ! (Cradle Void )
@@ -782,6 +786,11 @@ toFlagsMap TargetDetails{..} =
782786setNameCache :: NameCache -> HscEnv -> HscEnv
783787setNameCache nc hsc = hsc { hsc_NC = nc }
784788
789+ #if MIN_VERSION_ghc(9,13,0)
790+ -- Moved back to implementation in GHC.
791+ checkHomeUnitsClosed' :: UnitEnv -> OS. Set UnitId -> [DriverMessages ]
792+ checkHomeUnitsClosed' ue _ = checkHomeUnitsClosed ue
793+ #elif MIN_VERSION_ghc(9,3,0)
785794-- This function checks the important property that if both p and q are home units
786795-- then any dependency of p, which transitively depends on q is also a home unit.
787796-- GHC had an implementation of this function, but it was horribly inefficient
@@ -838,6 +847,7 @@ checkHomeUnitsClosed' ue home_id_set
838847 Just depends ->
839848 let todo'' = (depends OS. \\ done) `OS.union` todo'
840849 in DigraphNode uid uid (OS. toList depends) : go (OS. insert uid done) todo''
850+ #endif
841851
842852-- | Create a mapping from FilePaths to HscEnvEqs
843853-- This combines all the components we know about into
0 commit comments