[project @ 2003-09-23 15:10:23 by simonpj]
[ghc-hetmet.git] / ghc / compiler / typecheck / TcIfaceSig.lhs
index e1d3230..ebfdb49 100644 (file)
@@ -55,8 +55,20 @@ signatures.
 tcInterfaceSigs :: [RenamedTyClDecl]   -- Ignore non-sig-decls in these decls
                -> TcM TcGblEnv
                
+-- May 2003: 
+--     NOTE 1: careful about the side-effected EPS
+--             in the two tcExtendGlobalValueEnv calls
+--     NOTE 2: no point in tying the knot with fixM; all
+--             the important knot-tying comes via the PCS global variable
+
 tcInterfaceSigs decls = 
   zapEnv (fixM (tc_interface_sigs decls)) `thenM` \ (_,sig_ids) ->
+       -- The zapEnv dramatically trims the environment, solely
+       -- to plug the space leak that would otherwise be caused
+       -- by a rich environment bound into lots of lazy thunks
+       -- The thunks are the lazily-typechecked IdInfo of the 
+       -- imported things.
+
   tcExtendGlobalValEnv sig_ids getGblEnv  `thenM` \ gbl_env ->
   returnM gbl_env
        -- We tie a knot so that the Ids read out of interfaces are in scope
@@ -218,12 +230,6 @@ tcCoreExpr (UfVar name)
 tcCoreExpr (UfLit lit)
   = returnM (Lit lit)
 
--- The dreaded lit-lits are also similar, except here the type
--- is read in explicitly rather than being implicit
-tcCoreExpr (UfLitLit lit ty)
-  = tcIfaceType ty             `thenM` \ ty' ->
-    returnM (Lit (MachLitLit lit ty'))
-
 tcCoreExpr (UfFCall cc ty)
   = tcIfaceType ty     `thenM` \ ty' ->
     newUnique          `thenM` \ u ->
@@ -337,12 +343,6 @@ tcCoreAlt scrut_ty (UfLitAlt lit, names, rhs)
     tcCoreExpr rhs             `thenM` \ rhs' ->
     returnM (LitAlt lit, [], rhs')
 
-tcCoreAlt scrut_ty (UfLitLitAlt str ty, names, rhs)
-  = ASSERT( null names )
-    tcCoreExpr rhs             `thenM` \ rhs' ->
-    tcIfaceType ty             `thenM` \ ty' ->
-    returnM (LitAlt (MachLitLit str ty'), [], rhs')
-
 -- A case alternative is made quite a bit more complicated
 -- by the fact that we omit type annotations because we can
 -- work them out.  True enough, but its not that easy!