summaryrefslogtreecommitdiff
path: root/compiler/GHC/Stg/Syntax.hs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/GHC/Stg/Syntax.hs')
-rw-r--r--compiler/GHC/Stg/Syntax.hs8
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.