From 17fdd8ad14910060688239d99fa12968276d4095 Mon Sep 17 00:00:00 2001 From: simonpj Date: Thu, 28 Jun 2001 08:36:30 +0000 Subject: [PATCH] [project @ 2001-06-28 08:36:30 by simonpj] Comment and import wibbles --- ghc/compiler/coreSyn/CoreUtils.lhs | 2 +- ghc/compiler/coreSyn/Subst.lhs | 15 ++++++++------- ghc/compiler/stranal/StrictAnal.lhs | 2 +- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/ghc/compiler/coreSyn/CoreUtils.lhs b/ghc/compiler/coreSyn/CoreUtils.lhs index b3cab66..bea8316 100644 --- a/ghc/compiler/coreSyn/CoreUtils.lhs +++ b/ghc/compiler/coreSyn/CoreUtils.lhs @@ -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` diff --git a/ghc/compiler/coreSyn/Subst.lhs b/ghc/compiler/coreSyn/Subst.lhs index 0b88ea0..1633362 100644 --- a/ghc/compiler/coreSyn/Subst.lhs +++ b/ghc/compiler/coreSyn/Subst.lhs @@ -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 diff --git a/ghc/compiler/stranal/StrictAnal.lhs b/ghc/compiler/stranal/StrictAnal.lhs index aeb1c3f..bac6b14 100644 --- a/ghc/compiler/stranal/StrictAnal.lhs +++ b/ghc/compiler/stranal/StrictAnal.lhs @@ -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, -- 1.7.10.4