[project @ 1998-03-12 17:27:22 by simonpj]
[ghc-hetmet.git] / ghc / compiler / simplCore / ConFold.lhs
index aa2a490..7c09ad1 100644 (file)
@@ -13,13 +13,13 @@ module ConFold      ( completePrim ) where
 #include "HsVersions.h"
 
 import CoreSyn
-import CoreUnfold      ( Unfolding, SimpleUnfolding )
+import CoreUnfold      ( Unfolding )
 import Id              ( idType )
 import Literal         ( mkMachInt, mkMachWord, Literal(..) )
--- import MagicUFs             ( MagicUnfoldingFun )
 import PrimOp          ( PrimOp(..) )
 import SimplEnv
 import SimplMonad
+import SimplUtils      ( newId )
 import TysWiredIn      ( trueDataCon, falseDataCon )
 
 import Char            ( ord, chr )
@@ -90,7 +90,7 @@ completePrim env SeqOp [TyArg ty, LitArg lit]
   = returnSmpl (Lit (mkMachInt 1))
 
 completePrim env op@SeqOp args@[TyArg ty, VarArg var]
-  | isEvaluated (lookupRhsInfo env var) = returnSmpl (Lit (mkMachInt 1))  -- var is eval'd
+  | isEvaluated (lookupUnfolding env var) = returnSmpl (Lit (mkMachInt 1))  -- var is eval'd
   | otherwise                          = returnSmpl (Prim op args)       -- var not eval'd
 \end{code}
 
@@ -192,22 +192,7 @@ completePrim env op args
 
        ---------   Floats --------------
     oneFloatLit FloatNegOp  f  = return_float (-f)
-#if __GLASGOW_HASKELL__ <= 22
-    oneFloatLit FloatExpOp  f  = return_float (exp f)
-    oneFloatLit FloatLogOp  f  = return_float (log f)
-    oneFloatLit FloatSqrtOp f  = return_float (sqrt f)
-    oneFloatLit FloatSinOp  f  = return_float (sin f)
-    oneFloatLit FloatCosOp  f  = return_float (cos f)
-    oneFloatLit FloatTanOp  f  = return_float (tan f)
-    oneFloatLit FloatAsinOp f  = return_float (asin f)
-    oneFloatLit FloatAcosOp f  = return_float (acos f)
-    oneFloatLit FloatAtanOp f  = return_float (atan f)
-    oneFloatLit FloatSinhOp f  = return_float (sinh f)
-    oneFloatLit FloatCoshOp f  = return_float (cosh f)
-    oneFloatLit FloatTanhOp f  = return_float (tanh f)
-#else
-    -- hard to do all that in Rationals ?? (WDP 94/10) ToDo
-#endif
+    -- hard to do float ops in Rationals ?? (WDP 94/10) ToDo
     oneFloatLit _          _   = give_up
 
     twoFloatLits FloatGtOp    f1 f2          = return_bool (f1 >  f2)