[project @ 2003-11-03 15:27:32 by simonpj]
[ghc-hetmet.git] / ghc / compiler / prelude / PrimOp.lhs
index c087f39..a9ac056 100644 (file)
@@ -7,7 +7,7 @@
 module PrimOp (
        PrimOp(..), allThePrimOps,
        primOpType, primOpSig, primOpArity,
-       mkPrimOpIdName, primOpRdrName, primOpTag, primOpOcc,
+       primOpTag, maxPrimOpTag, primOpOcc,
 
        commutableOp,
 
@@ -15,9 +15,7 @@ module PrimOp (
        primOpOkForSpeculation, primOpIsCheap, primOpIsDupable,
        primOpHasSideEffects,
 
-       getPrimOpResultInfo,  PrimOpResultInfo(..),
-
-       eqCharName, eqIntName, eqFloatName, eqDoubleName, neqIntName,
+       getPrimOpResultInfo,  PrimOpResultInfo(..)
     ) where
 
 #include "HsVersions.h"
@@ -28,15 +26,10 @@ import TysWiredIn
 
 import NewDemand
 import Var             ( TyVar )
-import Name            ( Name, mkWiredInName )
-import RdrName         ( RdrName, mkRdrOrig )
 import OccName         ( OccName, pprOccName, mkVarOcc )
 import TyCon           ( TyCon, isPrimTyCon, tyConPrimRep )
 import Type            ( Type, mkForAllTys, mkFunTy, mkFunTys, typePrimRep, tyConAppTyCon )
-import PprType          () -- get at Outputable Type instance.
-import Unique          ( mkPrimOpIdUnique )
 import BasicTypes      ( Arity, Boxity(..) )
-import PrelNames       ( pREL_GHC, pREL_GHC_Name )
 import Outputable
 import FastTypes
 \end{code}
@@ -88,6 +81,7 @@ instance Show PrimOp where
 \end{code}
 
 An @Enum@-derived list would be better; meanwhile... (ToDo)
+
 \begin{code}
 allThePrimOps :: [PrimOp]
 allThePrimOps =
@@ -392,22 +386,12 @@ primOpType op
       GenPrimOp occ tyvars arg_tys res_ty -> 
        mkForAllTys tyvars (mkFunTys arg_tys res_ty)
 
-mkPrimOpIdName :: PrimOp -> Name
-       -- Make the name for the PrimOp's Id
-       -- We have to pass in the Id itself because it's a WiredInId
-       -- and hence recursive
-mkPrimOpIdName op
-  = mkWiredInName pREL_GHC (primOpOcc op) (mkPrimOpIdUnique (primOpTag op))
-
-primOpRdrName :: PrimOp -> RdrName 
-primOpRdrName op = mkRdrOrig pREL_GHC_Name (primOpOcc op)
-
 primOpOcc :: PrimOp -> OccName
 primOpOcc op = case (primOpInfo op) of
-                             Dyadic    occ _     -> occ
-                             Monadic   occ _     -> occ
-                             Compare   occ _     -> occ
-                             GenPrimOp occ _ _ _ -> occ
+               Dyadic    occ _     -> occ
+               Monadic   occ _     -> occ
+               Compare   occ _     -> occ
+               GenPrimOp occ _ _ _ -> occ
 
 -- primOpSig is like primOpType but gives the result split apart:
 -- (type variables, argument types, result type)
@@ -469,22 +453,6 @@ compare_fun_ty ty = mkFunTys [ty, ty] boolTy
 Output stuff:
 \begin{code}
 pprPrimOp  :: PrimOp -> SDoc
-pprPrimOp other_op
-  = getPprStyle $ \ sty ->
-    if ifaceStyle sty then     -- For interfaces Print it qualified with PrelGHC.
-       ptext SLIT("PrelGHC.") <> pprOccName occ
-    else
-       pprOccName occ
-  where
-    occ = primOpOcc other_op
+pprPrimOp other_op = pprOccName (primOpOcc other_op)
 \end{code}
 
-Names for some primops (for ndpFlatten/FlattenMonad.lhs)
-
-\begin{code}
-eqCharName       = mkPrimOpIdName CharEqOp
-eqIntName        = mkPrimOpIdName IntEqOp
-eqFloatName      = mkPrimOpIdName FloatEqOp
-eqDoubleName     = mkPrimOpIdName DoubleEqOp
-neqIntName       = mkPrimOpIdName IntNeOp
-\end{code}