diff options
author | Sylvain Henry <sylvain@haskus.fr> | 2020-05-07 19:01:37 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-06-13 02:13:02 -0400 |
commit | 8dc71f5577a541168951371bd55b51a588b57813 (patch) | |
tree | 8f821274d3b5a7a9a8595c3c4091a18d2257a5eb | |
parent | 72d086106d49bc18277f3a066e671e87e9b37a1b (diff) | |
download | haskell-8dc71f5577a541168951371bd55b51a588b57813.tar.gz |
Rename unsafeGetUnitInfo into unsafeLookupUnit
-rw-r--r-- | compiler/GHC/Driver/CodeOutput.hs | 4 | ||||
-rw-r--r-- | compiler/GHC/Driver/Main.hs | 2 | ||||
-rw-r--r-- | compiler/GHC/Driver/Make.hs | 2 | ||||
-rw-r--r-- | compiler/GHC/SysTools/ExtraObj.hs | 2 | ||||
-rw-r--r-- | compiler/GHC/Unit/State.hs | 8 | ||||
-rw-r--r-- | ghc/GHCi/UI.hs | 4 |
6 files changed, 11 insertions, 11 deletions
diff --git a/compiler/GHC/Driver/CodeOutput.hs b/compiler/GHC/Driver/CodeOutput.hs index 0c77ffc477..c614606186 100644 --- a/compiler/GHC/Driver/CodeOutput.hs +++ b/compiler/GHC/Driver/CodeOutput.hs @@ -131,7 +131,7 @@ outputC dflags filenm cmm_stream packages -- * -#include options from the cmdline and OPTIONS pragmas -- * the _stub.h file, if there is one. -- - let rts = unsafeGetUnitInfo dflags rtsUnitId + let rts = unsafeLookupUnit dflags rtsUnitId let cc_injects = unlines (map mk_include (unitIncludes rts)) mk_include h_file = @@ -223,7 +223,7 @@ outputForeignStubs dflags mod location stubs -- we need the #includes from the rts package for the stub files let rts_includes = - let rts_pkg = unsafeGetUnitInfo dflags rtsUnitId in + let rts_pkg = unsafeLookupUnit dflags rtsUnitId in concatMap mk_include (unitIncludes rts_pkg) mk_include i = "#include \"" ++ i ++ "\"\n" diff --git a/compiler/GHC/Driver/Main.hs b/compiler/GHC/Driver/Main.hs index ebc822aac5..95bad1e615 100644 --- a/compiler/GHC/Driver/Main.hs +++ b/compiler/GHC/Driver/Main.hs @@ -1192,7 +1192,7 @@ hscCheckSafe' m l = do packageTrusted _ Sf_SafeInferred False _ = True packageTrusted dflags _ _ m | isHomeModule dflags m = True - | otherwise = unitIsTrusted $ unsafeGetUnitInfo dflags (moduleUnit m) + | otherwise = unitIsTrusted $ unsafeLookupUnit dflags (moduleUnit m) lookup' :: Module -> Hsc (Maybe ModIface) lookup' m = do diff --git a/compiler/GHC/Driver/Make.hs b/compiler/GHC/Driver/Make.hs index c34df2c589..7aceafdd0b 100644 --- a/compiler/GHC/Driver/Make.hs +++ b/compiler/GHC/Driver/Make.hs @@ -310,7 +310,7 @@ warnUnusedPackages = do pit = eps_PIT eps let loadedPackages - = map (unsafeGetUnitInfo dflags) + = map (unsafeLookupUnit dflags) . nub . sort . map moduleUnit . moduleEnvKeys diff --git a/compiler/GHC/SysTools/ExtraObj.hs b/compiler/GHC/SysTools/ExtraObj.hs index 453dc83996..b0949ee889 100644 --- a/compiler/GHC/SysTools/ExtraObj.hs +++ b/compiler/GHC/SysTools/ExtraObj.hs @@ -55,7 +55,7 @@ mkExtraObj dflags extn xs -- set of include directories and PIC flags. cOpts = map Option (picCCOpts dflags) ++ map (FileOption "-I") - (unitIncludeDirs $ unsafeGetUnitInfo dflags rtsUnitId) + (unitIncludeDirs $ unsafeLookupUnit dflags rtsUnitId) -- When compiling assembler code, we drop the usual C options, and if the -- compiler is Clang, we add an extra argument to tell Clang to ignore diff --git a/compiler/GHC/Unit/State.hs b/compiler/GHC/Unit/State.hs index d3737c08e0..3ebce53b2a 100644 --- a/compiler/GHC/Unit/State.hs +++ b/compiler/GHC/Unit/State.hs @@ -25,7 +25,7 @@ module GHC.Unit.State ( lookupPackageName, improveUnit, searchPackageId, - unsafeGetUnitInfo, + unsafeLookupUnit, getInstalledPackageDetails, displayUnitId, listVisibleModuleNames, @@ -424,11 +424,11 @@ extendUnitInfoMap (UnitInfoMap pkg_map closure) new_pkgs -- | Looks up the package with the given id in the package state, panicing if it is -- not found -unsafeGetUnitInfo :: HasDebugCallStack => DynFlags -> Unit -> UnitInfo -unsafeGetUnitInfo dflags pid = +unsafeLookupUnit :: HasDebugCallStack => DynFlags -> Unit -> UnitInfo +unsafeLookupUnit dflags pid = case lookupUnit dflags pid of Just config -> config - Nothing -> pprPanic "unsafeGetUnitInfo" (ppr pid) + Nothing -> pprPanic "unsafeLookupUnit" (ppr pid) lookupInstalledPackage :: PackageState -> UnitId -> Maybe UnitInfo lookupInstalledPackage pkgstate uid = lookupInstalledPackage' (unitInfoMap pkgstate) uid diff --git a/ghc/GHCi/UI.hs b/ghc/GHCi/UI.hs index 714b1d3fa4..17f8706308 100644 --- a/ghc/GHCi/UI.hs +++ b/ghc/GHCi/UI.hs @@ -57,7 +57,7 @@ import GHC.Driver.Types ( tyThingParent_maybe, handleFlagWarnings, getSafeMode, hsc_dynLinker, hsc_interp ) import GHC.Unit.Module import GHC.Types.Name -import GHC.Unit.State ( unitIsTrusted, unsafeGetUnitInfo, getInstalledPackageDetails, +import GHC.Unit.State ( unitIsTrusted, unsafeLookupUnit, getInstalledPackageDetails, listVisibleModuleNames, pprFlag ) import GHC.Iface.Syntax ( showToHeader ) import GHC.Core.Ppr.TyThing @@ -2360,7 +2360,7 @@ isSafeModule m = do packageTrusted dflags md | isHomeModule dflags md = True - | otherwise = unitIsTrusted $ unsafeGetUnitInfo dflags (moduleUnit md) + | otherwise = unitIsTrusted $ unsafeLookupUnit dflags (moduleUnit md) tallyPkgs dflags deps | not (packageTrustOn dflags) = (S.empty, S.empty) | otherwise = S.partition part deps |