X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fstranal%2FWorkWrap.lhs;h=fbc0bf7a7029c0f8ee6efc4e3b67008693dffccd;hb=7fc749a43b4b6b85d234fa95d4928648259584f4;hp=d061de5b8c711a44be5eb0028872068974eb130b;hpb=42b37bc4ee622d3a7745d451da26bf5a14f1e7ea;p=ghc-hetmet.git diff --git a/compiler/stranal/WorkWrap.lhs b/compiler/stranal/WorkWrap.lhs index d061de5..fbc0bf7 100644 --- a/compiler/stranal/WorkWrap.lhs +++ b/compiler/stranal/WorkWrap.lhs @@ -4,6 +4,13 @@ \section[WorkWrap]{Worker/wrapper-generating back-end of strictness analyser} \begin{code} +{-# OPTIONS -w #-} +-- The above warning supression flag is a temporary kludge. +-- While working on this module you are encouraged to remove it and fix +-- any warnings in the module. See +-- http://hackage.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#Warnings +-- for details + module WorkWrap ( wwTopBinds, mkWrapper ) where #include "HsVersions.h" @@ -26,7 +33,7 @@ import NewDemand ( Demand(..), StrictSig(..), DmdType(..), DmdResult(..), ) import UniqSupply ( UniqSupply, initUs_, returnUs, thenUs, mapUs, getUniqueUs, UniqSM ) import Unique ( hasKey ) -import BasicTypes ( RecFlag(..), isNonRec ) +import BasicTypes ( RecFlag(..), isNonRec, isNeverActive ) import VarEnv ( isEmptyVarEnv ) import Maybes ( orElse ) import DynFlags @@ -215,6 +222,11 @@ tryWW is_rec fn_id rhs -- fw = \ab -> (__inline (\x -> E)) (a,b) -- and the original __inline now vanishes, so E is no longer -- inside its __inline wrapper. Death! Disaster! + + || isNeverActive inline_prag + -- No point in worker/wrappering if the thing is never inlined! + -- Because the no-inline prag will prevent the wrapper ever + -- being inlined at a call site. = returnUs [ (new_fn_id, rhs) ] | is_thunk && worthSplittingThunk maybe_fn_dmd res_info