Commit 17fdd8ad authored by simonpj's avatar simonpj
Browse files

[project @ 2001-06-28 08:36:30 by simonpj]

Comment and import wibbles
parent 1928f698
......@@ -512,7 +512,7 @@ idAppIsBottom id n_val_args = appIsBottom (idStrictness id) n_val_args
\end{code}
@exprIsValue@ returns true for expressions that are certainly *already*
evaluated to WHNF. This is used to decide wether it's ok to change
evaluated to WHNF. This is used to decide whether it's ok to change
case x of _ -> e ===> e
and to decide whether it's safe to discard a `seq`
......
......@@ -544,10 +544,9 @@ substExpr subst expr
simplBndr :: Subst -> Var -> (Subst, Var)
-- Used for lambda and case-bound variables
-- Clone Id if necessary, substitute type
-- Return with IdInfo already substituted,
-- but occurrence info zapped
-- Return with IdInfo already substituted, but (fragile) occurrence info zapped
-- The substitution is extended only if the variable is cloned, because
-- we don't need to use it to track occurrence info.
-- we *don't* need to use it to track occurrence info.
simplBndr subst bndr
| isTyVar bndr = substTyVar subst bndr
| otherwise = subst_id isFragileOcc subst subst bndr
......@@ -559,9 +558,11 @@ simplLetId :: Subst -> Id -> (Subst, Id)
-- Clone Id if necessary
-- Substitute its type
-- Return an Id with completely zapped IdInfo
-- Augment the subtitution if the unique changed or if there's
-- interesting occurrence info
-- [A subsequent substIdInfo will restore its IdInfo]
-- [A subsequent substIdInfo will restore its IdInfo]
-- Augment the subtitution
-- if the unique changed, *or*
-- if there's interesting occurrence info
simplLetId subst@(Subst in_scope env) old_id
= (Subst (in_scope `extendInScopeSet` new_id) new_env, new_id)
where
......@@ -590,7 +591,7 @@ simplIdInfo subst old_info bndr
\begin{code}
-- substBndr and friends are used when doing expression substitution only
-- In this case we can preserve occurrence information, and indeed we want
-- In this case we can *preserve* occurrence information, and indeed we *want*
-- to do so else lose useful occ info in rules. Hence the calls to
-- simpl_id with keepOccInfo
......
......@@ -11,7 +11,7 @@ module StrictAnal ( saBinds ) where
#include "HsVersions.h"
import CmdLineOpts ( DynFlags, DynFlag(..), dopt )
import CmdLineOpts ( DynFlags, DynFlag(..) )
import CoreSyn
import Id ( setIdStrictness, setInlinePragma,
idDemandInfo, setIdDemandInfo, isBottomingId,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment