Commit 44fad4a9 authored by Sylvain Henry's avatar Sylvain Henry Committed by Marge Bot

Rename isDllName

I wanted to fix the dangling comment in `isDllName` ("This is the cause
of #", #8696 is already mentioned earlier). I took the opportunity to
change the function name to better reflect what it does.
parent 6a65b8c2
Pipeline #16659 passed with stages
in 373 minutes and 6 seconds
......@@ -1029,7 +1029,7 @@ labelDynamic dflags this_mod lbl =
externalDynamicRefs && (this_pkg /= rtsUnitId)
IdLabel n _ _ ->
isDllName dflags this_mod n
isDynLinkName dflags this_mod n
-- When compiling in the "dyn" way, each package is to be linked into
-- its own shared library.
......
......@@ -60,7 +60,7 @@ module GHC.Driver.Packages (
pprPackagesSimple,
pprModuleMap,
isIndefinite,
isDllName
isDynLinkName
)
where
......@@ -2122,12 +2122,9 @@ displayInstalledUnitId :: DynFlags -> InstalledUnitId -> Maybe String
displayInstalledUnitId dflags uid =
fmap sourcePackageIdString (lookupInstalledPackage dflags uid)
-- | Will the 'Name' come from a dynamically linked library?
isDllName :: DynFlags -> Module -> Name -> Bool
-- Despite the "dll", I think this function just means that
-- the symbol comes from another dynamically-linked package,
-- and applies on all platforms, not just Windows
isDllName dflags this_mod name
-- | Will the 'Name' come from a dynamically linked package?
isDynLinkName :: DynFlags -> Module -> Name -> Bool
isDynLinkName dflags this_mod name
| not (gopt Opt_ExternalDynamicRefs dflags) = False
| Just mod <- nameModule_maybe name
-- Issue #8696 - when GHC is dynamically linked, it will attempt
......@@ -2137,7 +2134,7 @@ isDllName dflags this_mod name
-- intra-package linking, because we don't generate indirect
-- (dynamic) symbols for intra-package calls. This means that if a
-- module with an intra-package call is loaded without its
-- dependencies, then GHC fails to link. This is the cause of #
-- dependencies, then GHC fails to link.
--
-- In the mean time, always force dynamic indirections to be
-- generated: when the module name isn't the module being
......
......@@ -76,7 +76,7 @@ import VarSet
import Literal ( Literal, literalType )
import Module ( Module )
import Outputable
import GHC.Driver.Packages ( isDllName )
import GHC.Driver.Packages ( isDynLinkName )
import GHC.Platform
import GHC.Core.Ppr( {- instances -} )
import PrimOp ( PrimOp, PrimCall )
......@@ -127,14 +127,14 @@ data StgArg
isDllConApp :: DynFlags -> Module -> DataCon -> [StgArg] -> Bool
isDllConApp dflags this_mod con args
| platformOS (targetPlatform dflags) == OSMinGW32
= isDllName dflags this_mod (dataConName con) || any is_dll_arg args
= isDynLinkName dflags this_mod (dataConName con) || any is_dll_arg args
| otherwise = False
where
-- 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))
&& isDllName dflags this_mod (idName v)
&& isDynLinkName dflags this_mod (idName v)
is_dll_arg _ = False
-- True of machine addresses; these are the things that don't work across DLLs.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment