X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2FbasicTypes%2FIdInfo.lhs;h=a3124f359489c50c166d092602a503aa3847304c;hb=41ac7eb30ff99535c24c39efd33e2b65ea458707;hp=b009794fb8a5715d3f497095d75bceb00961a7ab;hpb=55710e16202e985f8e4f910a09dfc2d0298ca255;p=ghc-hetmet.git diff --git a/compiler/basicTypes/IdInfo.lhs b/compiler/basicTypes/IdInfo.lhs index b009794..a3124f3 100644 --- a/compiler/basicTypes/IdInfo.lhs +++ b/compiler/basicTypes/IdInfo.lhs @@ -464,9 +464,11 @@ type InlinePragInfo = Activation %************************************************************************ \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 @@ -483,6 +485,17 @@ specInfoRules (SpecInfo rules _) = rules 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 + + %************************************************************************ %* *