projects
/
ghc-hetmet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b74d0f7
)
use the reader part of the monad for the inScope set
author
Simon Marlow
<simonmar@microsoft.com>
Thu, 3 May 2007 12:50:06 +0000
(12:50 +0000)
committer
Simon Marlow
<simonmar@microsoft.com>
Thu, 3 May 2007 12:50:06 +0000
(12:50 +0000)
compiler/deSugar/Coverage.lhs
patch
|
blob
|
history
diff --git
a/compiler/deSugar/Coverage.lhs
b/compiler/deSugar/Coverage.lhs
index
e56f231
..
a011df6
100644
(file)
--- a/
compiler/deSugar/Coverage.lhs
+++ b/
compiler/deSugar/Coverage.lhs
@@
-70,11
+70,11
@@
addCoverageTicksToBinds dflags mod mod_loc binds = do
(TTE
{ modName = mod_name
, declPath = []
(TTE
{ modName = mod_name
, declPath = []
+ , inScope = emptyVarSet
})
(TT
{ tickBoxCount = 0
, mixEntries = []
})
(TT
{ tickBoxCount = 0
, mixEntries = []
- , inScope = emptyVarSet
})
let entries = reverse $ mixEntries st
})
let entries = reverse $ mixEntries st
@@
-513,11
+513,11
@@
addTickArithSeqInfo (FromThenTo e1 e2 e3) =
\begin{code}
data TickTransState = TT { tickBoxCount:: Int
, mixEntries :: [MixEntry]
\begin{code}
data TickTransState = TT { tickBoxCount:: Int
, mixEntries :: [MixEntry]
- , inScope :: VarSet -- move the TickTransEnv
}
data TickTransEnv = TTE { modName :: String
, declPath :: [String]
}
data TickTransEnv = TTE { modName :: String
, declPath :: [String]
+ , inScope :: VarSet
}
-- deriving Show
}
-- deriving Show
@@
-556,11
+556,6
@@
getState = TM $ \ env st -> (st, noFVs, st)
setState :: (TickTransState -> TickTransState) -> TM ()
setState f = TM $ \ env st -> ((), noFVs, f st)
setState :: (TickTransState -> TickTransState) -> TM ()
setState f = TM $ \ env st -> ((), noFVs, f st)
-withState :: (TickTransState -> TickTransState) -> TM a -> TM a
-withState f (TM m) = TM $ \ env st ->
- case m env (f st) of
- (a, fvs, st') -> (a, fvs, st')
-
getEnv :: TM TickTransEnv
getEnv = TM $ \ env st -> (env, noFVs, st)
getEnv :: TM TickTransEnv
getEnv = TM $ \ env st -> (env, noFVs, st)
@@
-575,7
+570,7
@@
getFreeVars (TM m)
freeVar :: Id -> TM ()
freeVar id = TM $ \ env st ->
freeVar :: Id -> TM ()
freeVar id = TM $ \ env st ->
- if id `elemVarSet` inScope st
+ if id `elemVarSet` inScope env
then ((), unitOccEnv (nameOccName (idName id)) id, st)
else ((), noFVs, st)
then ((), unitOccEnv (nameOccName (idName id)) id, st)
else ((), noFVs, st)
@@
-588,7
+583,7
@@
getPathEntry = declPath `liftM` getEnv
bindLocals :: [Id] -> TM a -> TM a
bindLocals new_ids (TM m)
= TM $ \ env st ->
bindLocals :: [Id] -> TM a -> TM a
bindLocals new_ids (TM m)
= TM $ \ env st ->
- case m env st{ inScope = inScope st `extendVarSetList` new_ids } of
+ case m env{ inScope = inScope env `extendVarSetList` new_ids } st of
(r, fv, st') -> (r, fv `delListFromUFM` occs, st')
where occs = [ nameOccName (idName id) | id <- new_ids ]
(r, fv, st') -> (r, fv `delListFromUFM` occs, st')
where occs = [ nameOccName (idName id) | id <- new_ids ]