[project @ 2003-08-29 16:00:25 by simonmar]
[ghc-hetmet.git] / ghc / compiler / main / TidyPgm.lhs
index f5cd4cd..5785fa5 100644 (file)
@@ -15,7 +15,7 @@ import CoreFVs                ( ruleLhsFreeIds, ruleRhsFreeVars, exprSomeFreeVars )
 import CoreTidy                ( tidyExpr, tidyVarOcc, tidyIdRules )
 import PprCore                 ( pprIdRules )
 import CoreLint                ( showPass, endPass )
-import CoreUtils       ( exprArity, rhsIsNonUpd )
+import CoreUtils       ( exprArity, rhsIsStatic )
 import VarEnv
 import VarSet
 import Var             ( Id, Var )
@@ -469,8 +469,10 @@ tidyTopBinder mod ext_ids caf_info rec_tidy_env rhs tidy_rhs
        -- in the IdInfo of one early in the group
 
        -- The rhs is already tidied
-       
-  = ((orig_env', occ_env', subst_env'), id')
+
+  = ASSERT(isLocalId id)  -- "all Ids defined in this module are local
+                         -- until the CoreTidy phase"  --GHC comentary
+    ((orig_env', occ_env', subst_env'), id')
   where
     (orig_env', occ_env', name') = tidyTopName mod ns2 occ_env2
                                               is_external
@@ -617,12 +619,12 @@ hasCafRefs p arity expr
   | otherwise              = NoCafRefs
  where
   mentions_cafs = isFastTrue (cafRefs p expr)
-  is_caf = not (arity > 0 || rhsIsNonUpd expr)
+  is_caf = not (arity > 0 || rhsIsStatic expr)
   -- NB. we pass in the arity of the expression, which is expected
   -- to be calculated by exprArity.  This is because exprArity
   -- knows how much eta expansion is going to be done by 
   -- CorePrep later on, and we don't want to duplicate that
-  -- knowledge in rhsIsNonUpd below.
+  -- knowledge in rhsIsStatic below.
 
 cafRefs p (Var id)
        -- imported Ids first: