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
4 changed files:
- compiler/GHC/Driver/Downsweep.hs
- compiler/GHC/Driver/Make.hs
- compiler/GHC/SysTools/Cpp.hs
- compiler/GHC/Unit/State.hs
Changes:
| ... | ... | @@ -835,7 +835,7 @@ instantiationNodes uid unit_state = map (uid,) iuids_to_check |
| 835 | 835 | where
|
| 836 | 836 | iuids_to_check :: [InstantiatedUnit]
|
| 837 | 837 | iuids_to_check =
|
| 838 | - nubSort $ concatMap (goUnitId . fst) (explicitUnits unit_state)
|
|
| 838 | + nubSort $ concatMap (goUnitId . fst) (availableUnits unit_state)
|
|
| 839 | 839 | where
|
| 840 | 840 | goUnitId uid =
|
| 841 | 841 | [ recur
|
| ... | ... | @@ -964,7 +964,7 @@ checkHomeUnitsClosed ue |
| 964 | 964 | where
|
| 965 | 965 | external_depends = mapUniqMap (Set.fromList . unitDepends) (unitInfoMap this_units)
|
| 966 | 966 | this_units = homeUnitEnv_units this_uis
|
| 967 | - this_deps = [ toUnitId unit | (unit,Just _) <- explicitUnits this_units]
|
|
| 967 | + this_deps = [ toUnitId unit | (unit,Just _) <- availableUnits this_units]
|
|
| 968 | 968 | |
| 969 | 969 | graphNodes :: [Node UnitId UnitId]
|
| 970 | 970 | graphNodes = go Set.empty home_id_set
|
| ... | ... | @@ -479,7 +479,7 @@ warnUnusedPackages us dflags mod_graph = |
| 479 | 479 | guard (not $ null $ unitExposedModules ui)
|
| 480 | 480 | return (unitId ui, unitPackageName ui, unitPackageVersion ui, flag)
|
| 481 | 481 | |
| 482 | - unusedArgs = sortOn (\(u,_,_,_) -> u) $ mapMaybe resolve (explicitUnits us)
|
|
| 482 | + unusedArgs = sortOn (\(u,_,_,_) -> u) $ mapMaybe resolve (availableUnits us)
|
|
| 483 | 483 | |
| 484 | 484 | warn = singleMessage $ mkPlainMsgEnvelope diag_opts noSrcSpan (DriverUnusedPackages unusedArgs)
|
| 485 | 485 |
| ... | ... | @@ -186,7 +186,7 @@ doCpp logger tmpfs dflags unit_env opts input_fn output_fn = do |
| 186 | 186 | ghcVersionH <- getGhcVersionIncludeFlags dflags unit_env
|
| 187 | 187 | |
| 188 | 188 | -- MIN_VERSION macros
|
| 189 | - let uids = explicitUnits unit_state
|
|
| 189 | + let uids = availableUnits unit_state
|
|
| 190 | 190 | pkgs = mapMaybe (lookupUnit unit_state . fst) uids
|
| 191 | 191 | mb_macro_include <-
|
| 192 | 192 | if not (null pkgs) && gopt Opt_VersionMacros dflags
|
| ... | ... | @@ -369,16 +369,15 @@ data UnitState = UnitState { |
| 369 | 369 | -- is always mentioned before the units it depends on.
|
| 370 | 370 | preloadUnits :: [UnitId],
|
| 371 | 371 | |
| 372 | - -- | The units that can be used by the respective home unit. Despite the
|
|
| 373 | - -- identifier, this does not just cover units that are enabled explicitly
|
|
| 374 | - -- using flags but also units from the package database that are enabled
|
|
| 375 | - -- implicitly in case @-hide-all-packages@ is absent. The former are paired
|
|
| 376 | - -- with 'Just' applied to the respective flags, the latter are paired with
|
|
| 377 | - -- 'Nothing'.
|
|
| 372 | + -- | The units that can be used by the respective home unit. This covers units
|
|
| 373 | + -- that are enabled explicitly using flags as well as units from the package
|
|
| 374 | + -- database that are enabled implicitly in case @-hide-all-packages@ is
|
|
| 375 | + -- absent. The former are paired with 'Just' applied to the respective flags,
|
|
| 376 | + -- the latter are paired with 'Nothing'.
|
|
| 378 | 377 | --
|
| 379 | 378 | -- This field is used for generating version macros and “unused packages”
|
| 380 | 379 | -- warnings.
|
| 381 | - explicitUnits :: [(Unit, Maybe PackageArg)],
|
|
| 380 | + availableUnits :: [(Unit, Maybe PackageArg)],
|
|
| 382 | 381 | |
| 383 | 382 | homeUnitDepends :: Set UnitId,
|
| 384 | 383 | |
| ... | ... | @@ -412,7 +411,7 @@ emptyUnitState = UnitState { |
| 412 | 411 | trustedUnits = emptyTrustOverlay,
|
| 413 | 412 | packageNameMap = emptyUFM,
|
| 414 | 413 | preloadUnits = [],
|
| 415 | - explicitUnits = [],
|
|
| 414 | + availableUnits = [],
|
|
| 416 | 415 | homeUnitDepends = Set.empty,
|
| 417 | 416 | moduleNameProvidersMap = emptyUniqMap,
|
| 418 | 417 | pluginModuleNameProvidersMap = emptyUniqMap,
|
| ... | ... | @@ -912,7 +911,7 @@ mkUnitState logger unit_index cfg = do |
| 912 | 911 | let pkgname_map = listToUFM [ (unitPackageName p, unitInstanceOf p)
|
| 913 | 912 | | p <- pkgs2
|
| 914 | 913 | ]
|
| 915 | - -- The explicitUnits accurately reflects the set of units that are turned
|
|
| 914 | + -- 'availableUnits' accurately reflects the set of units that are turned
|
|
| 916 | 915 | -- on; as such, it also is the only way one can come up with requirements.
|
| 917 | 916 | -- The requirement context is directly based off of this: we simply
|
| 918 | 917 | -- look for nested unit IDs that are directly fed holes: the requirements
|
| ... | ... | @@ -954,7 +953,7 @@ mkUnitState logger unit_index cfg = do |
| 954 | 953 | -- Force the result to avoid leaking input parameters
|
| 955 | 954 | let !state = UnitState
|
| 956 | 955 | { preloadUnits = dep_preload
|
| 957 | - , explicitUnits = explicit_pkgs
|
|
| 956 | + , availableUnits = explicit_pkgs
|
|
| 958 | 957 | , homeUnitDepends = home_unit_deps
|
| 959 | 958 | , unitInfoMap = pkg_db
|
| 960 | 959 | , trustedUnits = trustUnitsOverlay
|