WorkWrap: Rip out unsafeGlobalDynFlags usage in mkWwInlineRule
authorBen Gamari <bgamari.foss@gmail.com>
Thu, 7 Jun 2018 17:20:49 +0000 (13:20 -0400)
committerBen Gamari <ben@smart-cactus.org>
Thu, 7 Jun 2018 22:06:29 +0000 (18:06 -0400)
Subscribers: rwbarton, thomie, carter

Differential Revision: https://phabricator.haskell.org/D4775

compiler/coreSyn/CoreUnfold.hs
compiler/stranal/WorkWrap.hs

index 20c8d0d..3d26d3c 100644 (file)
@@ -104,10 +104,10 @@ mkDFunUnfolding bndrs con ops
                   , df_args = map occurAnalyseExpr ops }
                   -- See Note [Occurrence analysis of unfoldings]
 
-mkWwInlineRule :: CoreExpr -> Arity -> Unfolding
-mkWwInlineRule expr arity
+mkWwInlineRule :: DynFlags -> CoreExpr -> Arity -> Unfolding
+mkWwInlineRule dflags expr arity
   = mkCoreUnfolding InlineStable True
-                   (simpleOptExpr unsafeGlobalDynFlags expr)
+                   (simpleOptExpr dflags expr)
                    (UnfWhen { ug_arity = arity, ug_unsat_ok = unSaturatedOk
                             , ug_boring_ok = boringCxtNotOk })
 
index 8da2a12..6289ba0 100644 (file)
@@ -562,7 +562,7 @@ splitFun dflags fam_envs fn_id fn_info wrap_dmds res_info rhs
                 -- inl_inline: see Note [Wrapper NoUserInline]
                 -- inl_rule:   RuleMatchInfo is (and must be) unaffected
 
-            wrap_id   = fn_id `setIdUnfolding`  mkWwInlineRule wrap_rhs arity
+            wrap_id   = fn_id `setIdUnfolding`  mkWwInlineRule dflags wrap_rhs arity
                               `setInlinePragma` wrap_prag
                               `setIdOccInfo`    noOccInfo
                                 -- Zap any loop-breaker-ness, to avoid bleating from Lint