[project @ 2002-03-04 17:01:26 by simonmar]
[ghc-hetmet.git] / ghc / compiler / coreSyn / CoreUtils.lhs
index 4e61e83..ab99d49 100644 (file)
@@ -48,16 +48,15 @@ import Name         ( hashName )
 import Literal         ( hashLiteral, literalType, litIsDupable, isZeroLit )
 import DataCon         ( DataCon, dataConRepArity, dataConArgTys, isExistentialDataCon, dataConTyCon )
 import PrimOp          ( PrimOp(..), primOpOkForSpeculation, primOpIsCheap )
-import Id              ( Id, idType, globalIdDetails, idNewStrictness, idLBVarInfo, 
+import Id              ( Id, idType, globalIdDetails, idNewStrictness, 
                          mkWildId, idArity, idName, idUnfolding, idInfo, isOneShotLambda,
                          isDataConId_maybe, mkSysLocal, isDataConId, isBottomingId
                        )
-import IdInfo          ( LBVarInfo(..),  
-                         GlobalIdDetails(..),
+import IdInfo          ( GlobalIdDetails(..),
                          megaSeqIdInfo )
 import NewDemand       ( appIsBottom )
 import Type            ( Type, mkFunTy, mkForAllTy, splitFunTy_maybe, splitFunTy,
-                         applyTys, isUnLiftedType, seqType, mkUTy, mkTyVarTy,
+                         applyTys, isUnLiftedType, seqType, mkTyVarTy,
                          splitForAllTy_maybe, isForAllTy, splitNewType_maybe, 
                          splitTyConApp_maybe, eqType, funResultTy, applyTy,
                          funResultTy, applyTy
@@ -111,12 +110,8 @@ mkPiTypes :: [Var] -> Type -> Type --    doesn't work...
 mkPiTypes vs ty = foldr mkPiType ty vs
 
 mkPiType v ty
-   | isId v    = add_usage (mkFunTy (idType v) ty)
+   | isId v    = mkFunTy (idType v) ty
    | otherwise = mkForAllTy v ty
-   where             
-     add_usage ty = case idLBVarInfo v of
-                      LBVarInfo u -> mkUTy u ty
-                      otherwise   -> ty
 \end{code}
 
 \begin{code}
@@ -868,7 +863,7 @@ eta_expand n us expr ty
        case splitFunTy_maybe ty of {
          Just (arg_ty, res_ty) -> Lam arg1 (eta_expand (n-1) us2 (App expr (Var arg1)) res_ty)
                                where
-                                  arg1       = mkSysLocal SLIT("eta") uniq arg_ty
+                                  arg1       = mkSysLocal FSLIT("eta") uniq arg_ty
                                   (uniq:us2) = us
                                   
        ; Nothing ->
@@ -1019,7 +1014,7 @@ coreBindsSize bs = foldr ((+) . bindSize) 0 bs
 exprSize :: CoreExpr -> Int
        -- A measure of the size of the expressions
        -- It also forces the expression pretty drastically as a side effect
-exprSize (Var v)       = varSize v 
+exprSize (Var v)       = v `seq` 1
 exprSize (Lit lit)     = lit `seq` 1
 exprSize (App f a)     = exprSize f + exprSize a
 exprSize (Lam b e)     = varSize b + exprSize e