From: wolfgang Date: Tue, 12 Apr 2005 19:58:57 +0000 (+0000) Subject: [project @ 2005-04-12 19:58:56 by wolfgang] X-Git-Tag: Initial_conversion_from_CVS_complete~750 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=48ea897f45f17d1e09af59034fad9271702c7393;p=ghc-hetmet.git [project @ 2005-04-12 19:58:56 by wolfgang] Dynamic Linking: On non-Win32, we can store cross-dylib pointers in static data, so disable a Win32-specific hack on the other platforms, to prevent code bloat. --- diff --git a/ghc/compiler/codeGen/CgCon.lhs b/ghc/compiler/codeGen/CgCon.lhs index 9a9f11a..d94cbf0 100644 --- a/ghc/compiler/codeGen/CgCon.lhs +++ b/ghc/compiler/codeGen/CgCon.lhs @@ -72,7 +72,10 @@ cgTopRhsCon :: Id -- Name of thing bound to this RHS cgTopRhsCon id con args = do { ; dflags <- getDynFlags - ; ASSERT( not (isDllConApp dflags con args) ) return () +#if mingw32_TARGET_OS + -- Windows DLLs have a problem with static cross-DLL refs. + ; ASSERT( not (isDllConApp dflags con args) ) return () +#endif ; ASSERT( args `lengthIs` dataConRepArity con ) return () -- LAY IT OUT diff --git a/ghc/compiler/coreSyn/CoreUtils.lhs b/ghc/compiler/coreSyn/CoreUtils.lhs index 24a6eb1..1951d8c 100644 --- a/ghc/compiler/coreSyn/CoreUtils.lhs +++ b/ghc/compiler/coreSyn/CoreUtils.lhs @@ -1175,6 +1175,8 @@ rhsIsStatic :: DynFlags -> CoreExpr -> Bool -- BUT watch out for -- (i) Any cross-DLL references kill static-ness completely -- because they must be 'executed' not statically allocated +-- ("DLL" here really only refers to Windows DLLs, on other platforms, +-- this is not necessary) -- -- (ii) We treat partial applications as redexes, because in fact we -- make a thunk for them that runs and builds a PAP @@ -1244,7 +1246,9 @@ rhsIsStatic dflags rhs = is_static False rhs is_static in_arg other_expr = go other_expr 0 where go (Var f) n_val_args - | not (isDllName dflags (idName f)) +#if mingw32_TARGET_OS + | not (isDllName dflags (idName f)) +#endif = saturated_data_con f n_val_args || (in_arg && n_val_args == 0) -- A naked un-applied variable is *not* deemed a static RHS