Skip to content

Commit

Permalink
Fix -dynamic-too on Windows
Browse files Browse the repository at this point in the history
If we're building the dynamic way too, then hasCafRefs needs to check
whether the dynamic way would use a dynamic name.
  • Loading branch information
Ian Lynagh committed May 20, 2013
1 parent 1227600 commit 5734f7a
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion compiler/main/TidyPgm.lhs
Expand Up @@ -1180,7 +1180,20 @@ hasCafRefs dflags this_pkg this_mod p arity expr
| otherwise = NoCafRefs
where
mentions_cafs = isFastTrue (cafRefsE dflags p expr)
is_dynamic_name = isDllName dflags this_pkg this_mod
is_dynamic_name n = if gopt Opt_BuildDynamicToo dflags
then -- If we're building the dynamic way too,
-- then we need to check whether it's a
-- dynamic name there too. Note that this
-- means that the vanila code is more
-- pessimistic on Windows when -dynamic-too
-- is used, but the alternative is that
-- -dynamic-too is unusable on Windows
-- as even the interfaces in the integer
-- package don't match.
is_dynamic_name' dflags n ||
is_dynamic_name' (doDynamicToo dflags) n
else is_dynamic_name' dflags n
is_dynamic_name' dflags' = isDllName dflags' this_pkg this_mod
is_caf = not (arity > 0 || rhsIsStatic (targetPlatform dflags) is_dynamic_name expr)
-- NB. we pass in the arity of the expression, which is expected
Expand Down

0 comments on commit 5734f7a

Please sign in to comment.