X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2FbasicTypes%2FIdInfo.lhs;h=7580703ae0ed121ad9450ca28ab72251f1ea97c6;hp=02ef0db1429b223f91011714dfb6bd61856cfc6d;hb=17b297d97d327620ed6bfab942f8992b2446f1bf;hpb=7eb8be6b5fcd80c4d9dfde6990dcb9fec4062d6b diff --git a/compiler/basicTypes/IdInfo.lhs b/compiler/basicTypes/IdInfo.lhs index 02ef0db..7580703 100644 --- a/compiler/basicTypes/IdInfo.lhs +++ b/compiler/basicTypes/IdInfo.lhs @@ -8,6 +8,13 @@ Haskell. [WDP 94/11]) \begin{code} +{-# OPTIONS_GHC -w #-} +-- The above warning supression flag is a temporary kludge. +-- While working on this module you are encouraged to remove it and fix +-- any warnings in the module. See +-- http://hackage.haskell.org/trac/ghc/wiki/WorkingConventions#Warnings +-- for details + module IdInfo ( GlobalIdDetails(..), notGlobalId, -- Not abstract @@ -232,7 +239,8 @@ data GlobalIdDetails = 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] @@ -463,9 +471,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 @@ -482,6 +492,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 + + %************************************************************************ %* * @@ -718,8 +739,8 @@ zapFragileInfo info = Just (info `setSpecInfo` emptySpecInfo type TickBoxId = Int data TickBoxOp - = TickBox Module !TickBoxId -- ^Tick box for Hpc-style coverage, - -- type = State# Void# + = TickBox Module {-# UNPACK #-} !TickBoxId + -- ^Tick box for Hpc-style coverage instance Outputable TickBoxOp where ppr (TickBox mod n) = ptext SLIT("tick") <+> ppr (mod,n)