= VanillaGlobal -- Imported from elsewhere, a default method Id.
| RecordSelId -- The Id for a record selector
- { sel_tycon :: TyCon
+ { sel_tycon :: TyCon -- For a data type family, this is the *instance* TyCon
+ -- not the family TyCon
, sel_label :: FieldLabel
, sel_naughty :: Bool -- True <=> naughty
} -- See Note [Naughty record selectors]
%************************************************************************
\begin{code}
--- CoreRules is used only in an idSpecialisation (move to IdInfo?)
data SpecInfo
- = SpecInfo [CoreRule] VarSet -- Locally-defined free vars of RHSs
+ = SpecInfo
+ [CoreRule]
+ VarSet -- Locally-defined free vars of *both* LHS and RHS of rules
+ -- Note [Rule dependency info]
emptySpecInfo :: SpecInfo
emptySpecInfo = SpecInfo [] emptyVarSet
seqSpecInfo (SpecInfo rules fvs) = seqRules rules `seq` seqVarSet fvs
\end{code}
+Note [Rule dependency info]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~
+THe VarSet in a SpecInfo is used for dependency analysis in the
+occurrence analyser. We must track free vars in *both* lhs and rhs. Why both?
+Consider
+ x = y
+ RULE f x = 4
+Then if we substitute y for x, we'd better do so in the
+ rule's LHS too, so we'd better ensure the dependency is respsected
+
+
%************************************************************************
%* *