diff options
author | Sylvain Henry <sylvain@haskus.fr> | 2020-03-03 13:36:56 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-03-13 02:30:22 -0400 |
commit | 44fad4a925c06fa2b14611ea08acea9210ee4e00 (patch) | |
tree | 584220a599fd2723cdd254aea0aa8383895b0c29 | |
parent | 6a65b8c2f5b4bc7abdb0ca3b5876df694acb8194 (diff) | |
download | haskell-44fad4a925c06fa2b14611ea08acea9210ee4e00.tar.gz |
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.
-rw-r--r-- | compiler/GHC/Cmm/CLabel.hs | 2 | ||||
-rw-r--r-- | compiler/GHC/Driver/Packages.hs | 13 | ||||
-rw-r--r-- | compiler/GHC/Stg/Syntax.hs | 6 |
3 files changed, 9 insertions, 12 deletions
diff --git a/compiler/GHC/Cmm/CLabel.hs b/compiler/GHC/Cmm/CLabel.hs index ef53715617..34217d317f 100644 --- a/compiler/GHC/Cmm/CLabel.hs +++ b/compiler/GHC/Cmm/CLabel.hs @@ -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. diff --git a/compiler/GHC/Driver/Packages.hs b/compiler/GHC/Driver/Packages.hs index 079bf6379f..e8bed631ff 100644 --- a/compiler/GHC/Driver/Packages.hs +++ b/compiler/GHC/Driver/Packages.hs @@ -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 diff --git a/compiler/GHC/Stg/Syntax.hs b/compiler/GHC/Stg/Syntax.hs index 46e70d477e..1b8381b1b7 100644 --- a/compiler/GHC/Stg/Syntax.hs +++ b/compiler/GHC/Stg/Syntax.hs @@ -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. |