diff options
author | Sylvain Henry <sylvain@haskus.fr> | 2020-05-07 20:04:44 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-06-13 02:13:02 -0400 |
commit | f6be6e432e53108075905c1fc7785d8b1f18a33f (patch) | |
tree | 299c122f83b982f3edfd4b56bcf1967191e5cb48 /compiler/GHC/Driver/CodeOutput.hs | |
parent | 8dc71f5577a541168951371bd55b51a588b57813 (diff) | |
download | haskell-f6be6e432e53108075905c1fc7785d8b1f18a33f.tar.gz |
Add allowVirtualUnits field in PackageState
Instead of always querying DynFlags to know whether we are allowed to
use virtual units (i.e. instantiated on-the-fly, cf Note [About units]
in GHC.Unit), we store it once for all in
`PackageState.allowVirtualUnits`.
This avoids using DynFlags too much (cf #17957) and is preliminary work
for #14335.
Diffstat (limited to 'compiler/GHC/Driver/CodeOutput.hs')
-rw-r--r-- | compiler/GHC/Driver/CodeOutput.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/GHC/Driver/CodeOutput.hs b/compiler/GHC/Driver/CodeOutput.hs index c614606186..db9b331d34 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 = unsafeLookupUnit dflags rtsUnitId + let rts = unsafeLookupUnit (pkgState 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 = unsafeLookupUnit dflags rtsUnitId in + let rts_pkg = unsafeLookupUnit (pkgState dflags) rtsUnitId in concatMap mk_include (unitIncludes rts_pkg) mk_include i = "#include \"" ++ i ++ "\"\n" |