FIX #1364: added support for C finalizers that run as soon as the value is not longer...
[ghc-hetmet.git] / compiler / prelude / PrimOp.lhs
index a98e3a0..61ccc8d 100644 (file)
@@ -4,7 +4,7 @@
 \section[PrimOp]{Primitive operations (machine-level)}
 
 \begin{code}
 \section[PrimOp]{Primitive operations (machine-level)}
 
 \begin{code}
-{-# OPTIONS -w #-}
+{-# OPTIONS -fno-warn-unused-binds #-}
 -- The above warning supression flag is a temporary kludge.
 -- While working on this module you are encouraged to remove it and fix
 -- any warnings in the module. See
 -- The above warning supression flag is a temporary kludge.
 -- While working on this module you are encouraged to remove it and fix
 -- any warnings in the module. See
@@ -39,6 +39,7 @@ import BasicTypes     ( Arity, Boxity(..) )
 import Unique          ( Unique, mkPrimOpIdUnique )
 import Outputable
 import FastTypes
 import Unique          ( Unique, mkPrimOpIdUnique )
 import Outputable
 import FastTypes
+import FastString
 \end{code}
 
 %************************************************************************
 \end{code}
 
 %************************************************************************
@@ -130,9 +131,12 @@ data PrimOpInfo
                [Type] 
                Type 
 
                [Type] 
                Type 
 
+mkDyadic, mkMonadic, mkCompare :: FastString -> Type -> PrimOpInfo
 mkDyadic str  ty = Dyadic  (mkVarOccFS str) ty
 mkMonadic str ty = Monadic (mkVarOccFS str) ty
 mkCompare str ty = Compare (mkVarOccFS str) ty
 mkDyadic str  ty = Dyadic  (mkVarOccFS str) ty
 mkMonadic str ty = Monadic (mkVarOccFS str) ty
 mkCompare str ty = Compare (mkVarOccFS str) ty
+
+mkGenPrimOp :: FastString -> [TyVar] -> [Type] -> Type -> PrimOpInfo
 mkGenPrimOp str tvs tys ty = GenPrimOp (mkVarOccFS str) tvs tys ty
 \end{code}
 
 mkGenPrimOp str tvs tys ty = GenPrimOp (mkVarOccFS str) tvs tys ty
 \end{code}
 
@@ -282,12 +286,6 @@ These primops are pretty wierd.
 The constraints aren't currently checked by the front end, but the
 code generator will fall over if they aren't satisfied.
 
 The constraints aren't currently checked by the front end, but the
 code generator will fall over if they aren't satisfied.
 
-\begin{code}
-#ifdef DEBUG
-primOpInfo op = pprPanic "primOpInfo:" (ppr op)
-#endif
-\end{code}
-
 %************************************************************************
 %*                                                                     *
 \subsubsection[PrimOp-ool]{Which PrimOps are out-of-line}
 %************************************************************************
 %*                                                                     *
 \subsubsection[PrimOp-ool]{Which PrimOps are out-of-line}
@@ -464,6 +462,7 @@ commutableOp :: PrimOp -> Bool
 
 Utils:
 \begin{code}
 
 Utils:
 \begin{code}
+dyadic_fun_ty, monadic_fun_ty, compare_fun_ty :: Type -> Type
 dyadic_fun_ty  ty = mkFunTys [ty, ty] ty
 monadic_fun_ty ty = mkFunTy  ty ty
 compare_fun_ty ty = mkFunTys [ty, ty] boolTy
 dyadic_fun_ty  ty = mkFunTys [ty, ty] ty
 monadic_fun_ty ty = mkFunTy  ty ty
 compare_fun_ty ty = mkFunTys [ty, ty] boolTy