projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix warnings in basicTypes/NameEnv
[ghc-hetmet.git]
/
compiler
/
basicTypes
/
IdInfo.lhs
diff --git
a/compiler/basicTypes/IdInfo.lhs
b/compiler/basicTypes/IdInfo.lhs
index
3261adf
..
3e64ee5
100644
(file)
--- a/
compiler/basicTypes/IdInfo.lhs
+++ b/
compiler/basicTypes/IdInfo.lhs
@@
-8,6
+8,13
@@
Haskell. [WDP 94/11])
\begin{code}
Haskell. [WDP 94/11])
\begin{code}
+{-# OPTIONS -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/Commentary/CodingStyle#Warnings
+-- for details
+
module IdInfo (
GlobalIdDetails(..), notGlobalId, -- Not abstract
module IdInfo (
GlobalIdDetails(..), notGlobalId, -- Not abstract
@@
-65,7
+72,7
@@
module IdInfo (
-- Specialisation
SpecInfo(..), specInfo, setSpecInfo, isEmptySpecInfo,
-- Specialisation
SpecInfo(..), specInfo, setSpecInfo, isEmptySpecInfo,
- specInfoFreeVars, specInfoRules, seqSpecInfo,
+ specInfoFreeVars, specInfoRules, seqSpecInfo, setSpecInfoHead,
-- CAF info
CafInfo(..), cafInfo, ppCafInfo, setCafInfo, mayHaveCafRefs,
-- CAF info
CafInfo(..), cafInfo, ppCafInfo, setCafInfo, mayHaveCafRefs,
@@
-82,6
+89,7
@@
module IdInfo (
import CoreSyn
import Class
import PrimOp
import CoreSyn
import Class
import PrimOp
+import Name
import Var
import VarSet
import BasicTypes
import Var
import VarSet
import BasicTypes
@@
-95,7
+103,6
@@
import Module
import Data.Maybe
#ifdef OLD_STRICTNESS
import Data.Maybe
#ifdef OLD_STRICTNESS
-import Name
import Demand
import qualified Demand
import Util
import Demand
import qualified Demand
import Util
@@
-232,7
+239,8
@@
data GlobalIdDetails
= VanillaGlobal -- Imported from elsewhere, a default method Id.
| RecordSelId -- The Id for a record selector
= 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]
, sel_label :: FieldLabel
, sel_naughty :: Bool -- True <=> naughty
} -- See Note [Naughty record selectors]
@@
-463,9
+471,13
@@
type InlinePragInfo = Activation
%************************************************************************
\begin{code}
%************************************************************************
\begin{code}
--- CoreRules is used only in an idSpecialisation (move to IdInfo?)
data SpecInfo
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. I don't think it needs to include the
+ -- ru_fn though.
+ -- Note [Rule dependency info] in OccurAnal
emptySpecInfo :: SpecInfo
emptySpecInfo = SpecInfo [] emptyVarSet
emptySpecInfo :: SpecInfo
emptySpecInfo = SpecInfo [] emptyVarSet
@@
-479,10
+491,17
@@
specInfoFreeVars (SpecInfo _ fvs) = fvs
specInfoRules :: SpecInfo -> [CoreRule]
specInfoRules (SpecInfo rules _) = rules
specInfoRules :: SpecInfo -> [CoreRule]
specInfoRules (SpecInfo rules _) = rules
+setSpecInfoHead :: Name -> SpecInfo -> SpecInfo
+setSpecInfoHead fn (SpecInfo rules fvs)
+ = SpecInfo (map set_head rules) fvs
+ where
+ set_head rule = rule { ru_fn = fn }
+
seqSpecInfo (SpecInfo rules fvs) = seqRules rules `seq` seqVarSet fvs
\end{code}
seqSpecInfo (SpecInfo rules fvs) = seqRules rules `seq` seqVarSet fvs
\end{code}
+
%************************************************************************
%* *
\subsection[worker-IdInfo]{Worker info about an @Id@}
%************************************************************************
%* *
\subsection[worker-IdInfo]{Worker info about an @Id@}
@@
-683,11
+702,11
@@
zapLamInfo info@(IdInfo {occInfo = occ, newDemandInfo = demand})
-- The "unsafe" occ info is the ones that say I'm not in a lambda
-- because that might not be true for an unsaturated lambda
is_safe_occ (OneOcc in_lam _ _) = in_lam
-- The "unsafe" occ info is the ones that say I'm not in a lambda
-- because that might not be true for an unsaturated lambda
is_safe_occ (OneOcc in_lam _ _) = in_lam
- is_safe_occ other = True
+ is_safe_occ _other = True
safe_occ = case occ of
OneOcc _ once int_cxt -> OneOcc insideLam once int_cxt
safe_occ = case occ of
OneOcc _ once int_cxt -> OneOcc insideLam once int_cxt
- other -> occ
+ _other -> occ
is_safe_dmd Nothing = True
is_safe_dmd (Just dmd) = not (isStrictDmd dmd)
is_safe_dmd Nothing = True
is_safe_dmd (Just dmd) = not (isStrictDmd dmd)
@@
-703,9
+722,13
@@
zapDemandInfo info@(IdInfo {newDemandInfo = dmd})
\begin{code}
zapFragileInfo :: IdInfo -> Maybe IdInfo
-- Zap info that depends on free variables
\begin{code}
zapFragileInfo :: IdInfo -> Maybe IdInfo
-- Zap info that depends on free variables
-zapFragileInfo info = Just (info `setSpecInfo` emptySpecInfo
- `setWorkerInfo` NoWorker
- `setUnfoldingInfo` NoUnfolding)
+zapFragileInfo info
+ = Just (info `setSpecInfo` emptySpecInfo
+ `setWorkerInfo` NoWorker
+ `setUnfoldingInfo` NoUnfolding
+ `setOccInfo` if isFragileOcc occ then NoOccInfo else occ)
+ where
+ occ = occInfo info
\end{code}
%************************************************************************
\end{code}
%************************************************************************
@@
-718,12
+741,9
@@
zapFragileInfo info = Just (info `setSpecInfo` emptySpecInfo
type TickBoxId = Int
data TickBoxOp
type TickBoxId = Int
data TickBoxOp
- = TickBox Module !TickBoxId -- ^Tick box for Hpc-style coverage,
- -- type = State# Void#
- | BinaryTickBox Module !TickBoxId !TickBoxId
- -- ^Binary tick box, with a tick for result = True, result = False,
- -- type = Bool -> Bool
+ = TickBox Module {-# UNPACK #-} !TickBoxId
+ -- ^Tick box for Hpc-style coverage
+
instance Outputable TickBoxOp where
ppr (TickBox mod n) = ptext SLIT("tick") <+> ppr (mod,n)
instance Outputable TickBoxOp where
ppr (TickBox mod n) = ptext SLIT("tick") <+> ppr (mod,n)
- ppr (BinaryTickBox mod t f) = ptext SLIT("btick") <+> ppr (mod,t,f)
\end{code}
\end{code}