X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Fprelude%2FPrimRep.lhs;h=94ab0c50f2f731e60ad766d157317d288e980076;hb=e7498a3ee1d0484d02a9e86633cc179c76ebf36e;hp=b4fbf55e9f9e2019e0d41aed1b8b23f86d4fb7c5;hpb=6c381e873e222417d9a67aeec77b9555eca7b7a8;p=ghc-hetmet.git diff --git a/ghc/compiler/prelude/PrimRep.lhs b/ghc/compiler/prelude/PrimRep.lhs index b4fbf55..94ab0c5 100644 --- a/ghc/compiler/prelude/PrimRep.lhs +++ b/ghc/compiler/prelude/PrimRep.lhs @@ -19,7 +19,7 @@ module PrimRep ( guessPrimRep ) where -import Ubiq +IMP_Ubiq() import Pretty -- pretty-printing code import Util @@ -50,7 +50,7 @@ data PrimRep | 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] @@ -65,7 +65,6 @@ data PrimRep -- (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} %************************************************************************ @@ -86,7 +85,8 @@ isFollowableRep :: PrimRep -> Bool 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 @@ -166,7 +166,7 @@ showPrimRep DoubleRep = "StgDouble" 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 @@ -186,15 +186,17 @@ All local C variables of @ArrayRep@ are declared in C as type @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