-- then we'll get a dfun which is a pair of two INLINE lambdas
size_up (Note _ body) = size_up body -- Other notes cost nothing
+
+ size_up (Cast e _) = size_up e
size_up (App fun (Type t)) = size_up fun
size_up (App fun arg) = size_up_app fun [arg]
\begin{code}
callSiteInline :: DynFlags
-> Bool -- True <=> the Id can be inlined
- -> Bool -- 'inline' note at call site
-> OccInfo
-> Id -- The Id
-> [Bool] -- One for each value arg; True if it is interesting
-> Maybe CoreExpr -- Unfolding, if any
-callSiteInline dflags active_inline inline_call occ id arg_infos interesting_cont
+callSiteInline dflags active_inline occ id arg_infos interesting_cont
= case idUnfolding id of {
NoUnfolding -> Nothing ;
OtherCon cs -> Nothing ;
-- consider_safe decides whether it's a good idea to
-- inline something, given that there's no
-- work-duplication issue (the caller checks that).
- | inline_call = True
-
- | otherwise
= case guidance of
UnfoldNever -> False
UnfoldIfGoodArgs n_vals_wanted arg_discounts size res_discount