[Git][ghc/ghc][wip/jeltsch/explicit-units-doc-fix] Deleted 1 commit: Change `explicitUnits` to `availableUnits`
Wolfgang Jeltsch pushed to branch wip/jeltsch/explicit-units-doc-fix at Glasgow Haskell Compiler / GHC WARNING: The push did not contain any new commits, but force pushed to delete the commits and changes below. Deleted commits: 613de641 by Wolfgang Jeltsch at 2026-09-08T20:23:39+03:00 Change `explicitUnits` to `availableUnits` The name `explicitUnits` is wrong, since only those units that are paired with `Just` values in this field are made available explicitly. - - - - - 4 changed files: - compiler/GHC/Driver/Downsweep.hs - compiler/GHC/Driver/Make.hs - compiler/GHC/SysTools/Cpp.hs - compiler/GHC/Unit/State.hs Changes: ===================================== compiler/GHC/Driver/Downsweep.hs ===================================== @@ -835,7 +835,7 @@ instantiationNodes uid unit_state = map (uid,) iuids_to_check where iuids_to_check :: [InstantiatedUnit] iuids_to_check = - nubSort $ concatMap (goUnitId . fst) (explicitUnits unit_state) + nubSort $ concatMap (goUnitId . fst) (availableUnits unit_state) where goUnitId uid = [ recur @@ -964,7 +964,7 @@ checkHomeUnitsClosed ue where external_depends = mapUniqMap (Set.fromList . unitDepends) (unitInfoMap this_units) this_units = homeUnitEnv_units this_uis - this_deps = [ toUnitId unit | (unit,Just _) <- explicitUnits this_units] + this_deps = [ toUnitId unit | (unit,Just _) <- availableUnits this_units] graphNodes :: [Node UnitId UnitId] graphNodes = go Set.empty home_id_set ===================================== compiler/GHC/Driver/Make.hs ===================================== @@ -479,7 +479,7 @@ warnUnusedPackages us dflags mod_graph = guard (not $ null $ unitExposedModules ui) return (unitId ui, unitPackageName ui, unitPackageVersion ui, flag) - unusedArgs = sortOn (\(u,_,_,_) -> u) $ mapMaybe resolve (explicitUnits us) + unusedArgs = sortOn (\(u,_,_,_) -> u) $ mapMaybe resolve (availableUnits us) warn = singleMessage $ mkPlainMsgEnvelope diag_opts noSrcSpan (DriverUnusedPackages unusedArgs) ===================================== compiler/GHC/SysTools/Cpp.hs ===================================== @@ -186,7 +186,7 @@ doCpp logger tmpfs dflags unit_env opts input_fn output_fn = do ghcVersionH <- getGhcVersionIncludeFlags dflags unit_env -- MIN_VERSION macros - let uids = explicitUnits unit_state + let uids = availableUnits unit_state pkgs = mapMaybe (lookupUnit unit_state . fst) uids mb_macro_include <- if not (null pkgs) && gopt Opt_VersionMacros dflags ===================================== compiler/GHC/Unit/State.hs ===================================== @@ -369,16 +369,15 @@ data UnitState = UnitState { -- is always mentioned before the units it depends on. preloadUnits :: [UnitId], - -- | The units that can be used by the respective home unit. Despite the - -- identifier, this does not just cover units that are enabled explicitly - -- using flags but also units from the package database that are enabled - -- implicitly in case @-hide-all-packages@ is absent. The former are paired - -- with 'Just' applied to the respective flags, the latter are paired with - -- 'Nothing'. + -- | The units that can be used by the respective home unit. This covers units + -- that are enabled explicitly using flags as well as units from the package + -- database that are enabled implicitly in case @-hide-all-packages@ is + -- absent. The former are paired with 'Just' applied to the respective flags, + -- the latter are paired with 'Nothing'. -- -- This field is used for generating version macros and “unused packages” -- warnings. - explicitUnits :: [(Unit, Maybe PackageArg)], + availableUnits :: [(Unit, Maybe PackageArg)], homeUnitDepends :: Set UnitId, @@ -412,7 +411,7 @@ emptyUnitState = UnitState { trustedUnits = emptyTrustOverlay, packageNameMap = emptyUFM, preloadUnits = [], - explicitUnits = [], + availableUnits = [], homeUnitDepends = Set.empty, moduleNameProvidersMap = emptyUniqMap, pluginModuleNameProvidersMap = emptyUniqMap, @@ -912,7 +911,7 @@ mkUnitState logger unit_index cfg = do let pkgname_map = listToUFM [ (unitPackageName p, unitInstanceOf p) | p <- pkgs2 ] - -- The explicitUnits accurately reflects the set of units that are turned + -- 'availableUnits' accurately reflects the set of units that are turned -- on; as such, it also is the only way one can come up with requirements. -- The requirement context is directly based off of this: we simply -- look for nested unit IDs that are directly fed holes: the requirements @@ -954,7 +953,7 @@ mkUnitState logger unit_index cfg = do -- Force the result to avoid leaking input parameters let !state = UnitState { preloadUnits = dep_preload - , explicitUnits = explicit_pkgs + , availableUnits = explicit_pkgs , homeUnitDepends = home_unit_deps , unitInfoMap = pkg_db , trustedUnits = trustUnitsOverlay View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/613de6413d2d090889752ccd2d9ca691... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/613de6413d2d090889752ccd2d9ca691... You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help
participants (1)
-
Wolfgang Jeltsch (@jeltsch)