diff options
author | Sylvain Henry <sylvain@haskus.fr> | 2020-03-16 15:13:05 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-04-21 06:39:32 -0400 |
commit | 70be0fbcefa07ff164437476bf2809ea7c3ff495 (patch) | |
tree | 619f88217125ca6d722df4c16f000e752542729e /compiler/GHC/Runtime | |
parent | 6655f93324b7f1d30a6baaedfecae455d5e08e39 (diff) | |
download | haskell-70be0fbcefa07ff164437476bf2809ea7c3ff495.tar.gz |
GHC.Runtime: avoid DynFlags (#17957)
* add `getPlatform :: TcM Platform` helper
* remove unused `DynFlags` parameter from `emptyPLS`
Diffstat (limited to 'compiler/GHC/Runtime')
-rw-r--r-- | compiler/GHC/Runtime/Heap/Inspect.hs | 2 | ||||
-rw-r--r-- | compiler/GHC/Runtime/Linker.hs | 20 |
2 files changed, 11 insertions, 11 deletions
diff --git a/compiler/GHC/Runtime/Heap/Inspect.hs b/compiler/GHC/Runtime/Heap/Inspect.hs index 3802baf4df..0c856aa7a5 100644 --- a/compiler/GHC/Runtime/Heap/Inspect.hs +++ b/compiler/GHC/Runtime/Heap/Inspect.hs @@ -865,7 +865,7 @@ extractSubTerms recurse clos = liftM thdOf3 . go 0 0 -- This is a bit involved since we allow packing multiple fields -- within a single word. See also -- GHC.StgToCmm.Layout.mkVirtHeapOffsetsWithPadding - platform <- targetPlatform <$> getDynFlags + platform <- getPlatform let word_size = platformWordSizeInBytes platform endian = platformByteOrder platform size_b = primRepSizeB platform rep diff --git a/compiler/GHC/Runtime/Linker.hs b/compiler/GHC/Runtime/Linker.hs index 5da9a916af..c103feb3fc 100644 --- a/compiler/GHC/Runtime/Linker.hs +++ b/compiler/GHC/Runtime/Linker.hs @@ -127,15 +127,15 @@ modifyMbPLS_ :: DynLinker -> (Maybe PersistentLinkerState -> IO (Maybe PersistentLinkerState)) -> IO () modifyMbPLS_ dl f = modifyMVar_ (dl_mpls dl) f -emptyPLS :: DynFlags -> PersistentLinkerState -emptyPLS _ = PersistentLinkerState { - closure_env = emptyNameEnv, - itbl_env = emptyNameEnv, - pkgs_loaded = init_pkgs, - bcos_loaded = [], - objs_loaded = [], - temp_sos = [] } - +emptyPLS :: PersistentLinkerState +emptyPLS = PersistentLinkerState + { closure_env = emptyNameEnv + , itbl_env = emptyNameEnv + , pkgs_loaded = init_pkgs + , bcos_loaded = [] + , objs_loaded = [] + , temp_sos = [] + } -- Packages that don't need loading, because the compiler -- shares them with the interpreted program. -- @@ -280,7 +280,7 @@ reallyInitDynLinker :: HscEnv -> IO PersistentLinkerState reallyInitDynLinker hsc_env = do -- Initialise the linker state let dflags = hsc_dflags hsc_env - pls0 = emptyPLS dflags + pls0 = emptyPLS -- (a) initialise the C dynamic linker initObjLinker hsc_env |