guessPrimRep
) where
-import Ubiq
+IMP_Ubiq()
import Pretty -- pretty-printing code
import Util
| FloatRep -- floats
| DoubleRep -- doubles
- | MallocPtrRep -- This has to be a special kind because ccall
+ | ForeignObjRep -- This has to be a special kind because ccall
-- generates special code when passing/returning
-- one of these. [ADR]
-- (Primitive states are mapped onto this)
deriving (Eq, Ord)
-- Kinds are used in PrimTyCons, which need both Eq and Ord
- -- Text is needed for derived-Text on PrimitiveOps
\end{code}
%************************************************************************
isFollowableRep PtrRep = True
isFollowableRep ArrayRep = True
isFollowableRep ByteArrayRep = True
-isFollowableRep MallocPtrRep = True
+-- why is a MallocPtr followable? 4/96 SOF
+-- isFollowableRep ForeignObjRep = True
isFollowableRep StablePtrRep = False
-- StablePtrs aren't followable because they are just indices into a
showPrimRep ArrayRep = "StgArray" -- see comment below
showPrimRep ByteArrayRep = "StgByteArray"
showPrimRep StablePtrRep = "StgStablePtr"
-showPrimRep MallocPtrRep = "StgPtr" -- see comment below
+showPrimRep ForeignObjRep = "StgPtr" -- see comment below
showPrimRep VoidRep = "!!VOID_KIND!!"
guessPrimRep "D_" = DataPtrRep
@StgArray@. The coercion to a more precise C type is done just before
indexing (by the relevant C primitive-op macro).
-Nota Bene. There are three types associated with Malloc Pointers:
+Nota Bene. There are three types associated with @ForeignObj@ (MallocPtr++):
\begin{itemize}
\item
-@StgMallocClosure@ is the type of the thing the C world gives us.
+@StgForeignObjClosure@ is the type of the thing the prim. op @mkForeignObj@ returns.
+{- old comment for MallocPtr
(This typename is hardwired into @ppr_casm_results@ in
@PprAbsC.lhs@.)
+-}
\item
-@StgMallocPtr@ is the type of the thing we give the C world.
+@StgForeignObj@ is the type of the thing we give the C world.
\item
@StgPtr@ is the type of the (pointer to the) heap object which we