diff options
author | Sylvain Henry <sylvain@haskus.fr> | 2020-03-16 16:46:39 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-04-21 06:39:32 -0400 |
commit | 747093b7c23a1cf92b564eb3d9efe2adc15330df (patch) | |
tree | 06b74ab72984f98036a40fc441d37438a49a26a8 /compiler/GHC/Stg | |
parent | f2a98996e7792f572ab685f29742e3476be81166 (diff) | |
download | haskell-747093b7c23a1cf92b564eb3d9efe2adc15330df.tar.gz |
CmmToAsm DynFlags refactoring (#17957)
* Remove `DynFlags` parameter from `isDynLinkName`: `isDynLinkName` used
to test the global `ExternalDynamicRefs` flag. Now we test it outside of
`isDynLinkName`
* Add new fields into `NCGConfig`: current unit id, sse/bmi versions,
externalDynamicRefs, etc.
* Replace many uses of `DynFlags` by `NCGConfig`
* Moved `BMI/SSE` datatypes into `GHC.Platform`
Diffstat (limited to 'compiler/GHC/Stg')
-rw-r--r-- | compiler/GHC/Stg/Syntax.hs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/compiler/GHC/Stg/Syntax.hs b/compiler/GHC/Stg/Syntax.hs index 7ee13baef8..aefb49d988 100644 --- a/compiler/GHC/Stg/Syntax.hs +++ b/compiler/GHC/Stg/Syntax.hs @@ -126,15 +126,17 @@ data StgArg -- If so, we can't allocate it statically isDllConApp :: DynFlags -> Module -> DataCon -> [StgArg] -> Bool isDllConApp dflags this_mod con args - | platformOS (targetPlatform dflags) == OSMinGW32 - = isDynLinkName dflags this_mod (dataConName con) || any is_dll_arg args + | not (gopt Opt_ExternalDynamicRefs dflags) = False + | platformOS platform == OSMinGW32 + = isDynLinkName platform this_mod (dataConName con) || any is_dll_arg args | otherwise = False where + platform = targetPlatform dflags -- NB: typePrimRep1 is legit because any free variables won't have -- unlifted type (there are no unlifted things at top level) is_dll_arg :: StgArg -> Bool is_dll_arg (StgVarArg v) = isAddrRep (typePrimRep1 (idType v)) - && isDynLinkName dflags this_mod (idName v) + && isDynLinkName platform this_mod (idName v) is_dll_arg _ = False -- True of machine addresses; these are the things that don't work across DLLs. |