import RnEnv ( availName )
import TcInstUtil ( InstInfo(..) )
-import WorkWrap ( getWorkerId )
import CmdLineOpts
import Id ( Id, idType, idInfo, omitIfaceSigForId, isUserExportedId,
import DataCon ( StrictnessMark(..), dataConSig, dataConFieldLabels, dataConStrictMarks )
import IdInfo ( IdInfo, StrictnessInfo, ArityInfo, InlinePragInfo(..), inlinePragInfo,
arityInfo, ppArityInfo,
- strictnessInfo, ppStrictnessInfo,
+ strictnessInfo, ppStrictnessInfo, isBottomingStrictness,
cafInfo, ppCafInfo, specInfo,
cprInfo, ppCprInfo,
- workerExists, workerInfo, isBottomingStrictness
+ workerExists, workerInfo, ppWorkerInfo
)
import CoreSyn ( CoreExpr, CoreBind, Bind(..), rulesRules, rulesRhsFreeVars )
import CoreFVs ( exprSomeFreeVars, ruleSomeLhsFreeVars, ruleSomeFreeVars )
ifaceId get_idinfo needed_ids is_rec id rhs
= Just (hsep [sig_pretty, prag_pretty, char ';'], new_needed_ids)
where
- idinfo = get_idinfo id
+ core_idinfo = idInfo id
+ stg_idinfo = get_idinfo id
ty_pretty = pprType (idType id)
sig_pretty = hsep [ppr (getOccName id), dcolon, ty_pretty]
arity_pretty,
caf_pretty,
cpr_pretty,
- strict_pretty,
+ strict_pretty,
+ wrkr_pretty,
unfold_pretty,
ptext SLIT("##-}")]
------------ Arity --------------
- arity_pretty = ppArityInfo (arityInfo idinfo)
+ arity_pretty = ppArityInfo (arityInfo stg_idinfo)
------------ Caf Info --------------
- caf_pretty = ppCafInfo (cafInfo idinfo)
+ caf_pretty = ppCafInfo (cafInfo stg_idinfo)
------------ CPR Info --------------
- cpr_pretty = ppCprInfo (cprInfo idinfo)
+ cpr_pretty = ppCprInfo (cprInfo core_idinfo)
- ------------ Strictness and Worker --------------
- strict_info = strictnessInfo idinfo
- work_info = workerInfo idinfo
- has_worker = workerExists work_info
+ ------------ Strictness --------------
+ strict_info = strictnessInfo core_idinfo
bottoming_fn = isBottomingStrictness strict_info
- strict_pretty = ppStrictnessInfo strict_info <+> wrkr_pretty
+ strict_pretty = ppStrictnessInfo strict_info
- wrkr_pretty | not has_worker = empty
- | otherwise = ppr work_id
+ ------------ Worker --------------
+ work_info = workerInfo core_idinfo
+ has_worker = workerExists work_info
+ wrkr_pretty = ppWorkerInfo work_info
+ Just work_id = work_info
--- (Just work_id) = work_info
--- Temporary fix. We can't use the worker id saved by the w/w
--- pass because later optimisations may have changed it. So try
--- to snaffle from the wrapper code again ...
- work_id = getWorkerId id rhs
------------ Unfolding --------------
- inline_pragma = inlinePragInfo idinfo
+ inline_pragma = inlinePragInfo core_idinfo
dont_inline = case inline_pragma of
IMustNotBeINLINEd -> True
IAmALoopBreaker -> True
other -> False
- unfold_pretty | show_unfold = ptext SLIT("__u") <+> pprIfaceUnfolding rhs
+ unfold_pretty | show_unfold = ptext SLIT("__U") <+> pprIfaceUnfolding rhs
| otherwise = empty
show_unfold = not has_worker && -- Not unnecessary
rhs_is_small = couldBeSmallEnoughToInline (calcUnfoldingGuidance opt_UF_HiFileThreshold rhs)
------------ Specialisations --------------
- spec_info = specInfo idinfo
+ spec_info = specInfo core_idinfo
------------ Extra free Ids --------------
new_needed_ids | opt_OmitInterfacePragmas = emptyVarSet