import CoreTidy ( tidyExpr, tidyVarOcc, tidyIdRules )
import PprCore ( pprIdRules )
import CoreLint ( showPass, endPass )
-import CoreUtils ( exprArity, rhsIsNonUpd )
+import CoreUtils ( exprArity, rhsIsStatic )
import VarEnv
import VarSet
import Var ( Id, Var )
-- in the IdInfo of one early in the group
-- The rhs is already tidied
-
- = ((orig_env', occ_env', subst_env'), id')
+
+ = ASSERT(isLocalId id) -- "all Ids defined in this module are local
+ -- until the CoreTidy phase" --GHC comentary
+ ((orig_env', occ_env', subst_env'), id')
where
(orig_env', occ_env', name') = tidyTopName mod ns2 occ_env2
is_external
| otherwise = NoCafRefs
where
mentions_cafs = isFastTrue (cafRefs p expr)
- is_caf = not (arity > 0 || rhsIsNonUpd expr)
+ is_caf = not (arity > 0 || rhsIsStatic expr)
-- NB. we pass in the arity of the expression, which is expected
-- to be calculated by exprArity. This is because exprArity
-- knows how much eta expansion is going to be done by
-- CorePrep later on, and we don't want to duplicate that
- -- knowledge in rhsIsNonUpd below.
+ -- knowledge in rhsIsStatic below.
cafRefs p (Var id)
-- imported Ids first: