--- dumping PrimRep tag for unfoldings
-ppPrimRep :: PrimRep -> SDoc
-
-guessPrimRep :: String -> PrimRep -- a horrible "inverse" function
-decodePrimRep :: Char -> PrimRep -- of equal nature
-
-ppPrimRep k =
- char
- (case k of
- PtrRep -> 'P'
- CodePtrRep -> 'p'
- DataPtrRep -> 'd'
- CostCentreRep -> 'c' -- Pointer to a cost centre
- RetRep -> 'R'
- CharRep -> 'C'
- IntRep -> 'I'
- Int64Rep -> 'i'
- WordRep -> 'W'
- Word64Rep -> 'w'
- AddrRep -> 'A'
- FloatRep -> 'F'
- DoubleRep -> 'D'
- ArrayRep -> 'a'
- ByteArrayRep -> 'b'
- StablePtrRep -> 'S'
- ForeignObjRep -> 'f'
- VoidRep -> 'V'
- _ -> panic "ppPrimRep")
-
-showPrimRep PtrRep = "P_" -- short for StgPtr
-
-showPrimRep CodePtrRep = "P_" -- DEATH to StgFunPtr! (94/02/22 WDP)
- -- but aren't code pointers and function pointers different sizes
- -- on some machines (eg 80x86)? ADR
- -- Are you trying to ruin my life, or what? (WDP)
-
-showPrimRep DataPtrRep = "D_"
-showPrimRep RetRep = "StgRetAddr"
-showPrimRep CostCentreRep = "CostCentre"
-showPrimRep CharRep = "StgChar"
-showPrimRep IntRep = "I_" -- short for StgInt
-showPrimRep WordRep = "W_" -- short for StgWord
-showPrimRep Int64Rep = "LI_" -- short for StgLongInt
-showPrimRep Word64Rep = "LW_" -- short for StgLongWord
-showPrimRep AddrRep = "StgAddr"
-showPrimRep FloatRep = "StgFloat"
-showPrimRep DoubleRep = "StgDouble"
-showPrimRep ArrayRep = "StgArray" -- see comment below
-showPrimRep ByteArrayRep = "StgByteArray"
-showPrimRep StablePtrRep = "StgStablePtr"
-showPrimRep ForeignObjRep = "StgPtr" -- see comment below
-showPrimRep VoidRep = "!!VOID_KIND!!"
-
-showPrimRepToUser pr =
- case pr of
- CharRep -> "StgChar"
- IntRep -> "StgInt"
- WordRep -> "StgWord"
- Int64Rep -> "StgInt64"
- Word64Rep -> "StgWord64"
- AddrRep -> "StgAddr"
- FloatRep -> "StgFloat"
- DoubleRep -> "StgDouble"
- ArrayRep -> "StgArray"
- ByteArrayRep -> "StgByteArray"
- StablePtrRep -> "StgStablePtr"
- ForeignObjRep -> "StgPtr"
- _ -> panic ("showPrimRepToUser: " ++ showPrimRep pr)
-
-
-decodePrimRep ch =
- case ch of
- 'P' -> PtrRep
- 'p' -> CodePtrRep
- 'd' -> DataPtrRep
- 'c' -> CostCentreRep
- 'R' -> RetRep
- 'C' -> CharRep
- 'I' -> IntRep
- 'W' -> WordRep
- 'i' -> Int64Rep
- 'w' -> Word64Rep
- 'A' -> AddrRep
- 'F' -> FloatRep
- 'D' -> DoubleRep
- 'a' -> ArrayRep
- 'b' -> ByteArrayRep
- 'S' -> StablePtrRep
- 'f' -> ForeignObjRep
- 'V' -> VoidRep
- _ -> panic "decodePrimRep"
-
-guessPrimRep "D_" = DataPtrRep
-guessPrimRep "StgRetAddr" = RetRep
-guessPrimRep "StgChar" = CharRep
-guessPrimRep "I_" = IntRep
-guessPrimRep "LI_" = Int64Rep
-guessPrimRep "W_" = WordRep
-guessPrimRep "LW_" = Word64Rep
-guessPrimRep "StgAddr" = AddrRep
-guessPrimRep "StgFloat" = FloatRep
-guessPrimRep "StgDouble" = DoubleRep
-guessPrimRep "StgArray" = ArrayRep
-guessPrimRep "StgByteArray" = ByteArrayRep
-guessPrimRep "StgStablePtr" = StablePtrRep
+
+showPrimRep PtrRep = "P_" -- short for StgPtr
+showPrimRep CodePtrRep = "P_" -- DEATH to StgFunPtr! (94/02/22 WDP)
+showPrimRep DataPtrRep = "D_"
+showPrimRep RetRep = "P_"
+showPrimRep CostCentreRep = "CostCentre"
+showPrimRep CharRep = "C_"
+showPrimRep Int8Rep = "StgInt8"
+showPrimRep IntRep = "I_" -- short for StgInt
+showPrimRep WordRep = "W_" -- short for StgWord
+showPrimRep Int64Rep = "LI_" -- short for StgLongInt
+showPrimRep Word64Rep = "LW_" -- short for StgLongWord
+showPrimRep AddrRep = "StgAddr"
+showPrimRep FloatRep = "StgFloat"
+showPrimRep DoubleRep = "StgDouble"
+showPrimRep ArrayRep = "P_" -- see comment below
+showPrimRep PrimPtrRep = "P_"
+showPrimRep ByteArrayRep = "StgByteArray"
+showPrimRep StablePtrRep = "StgStablePtr"
+showPrimRep StableNameRep = "P_"
+showPrimRep ThreadIdRep = "StgTSO*"
+showPrimRep WeakPtrRep = "P_"
+showPrimRep ForeignObjRep = "StgAddr"
+showPrimRep VoidRep = "!!VOID_KIND!!"
+showPrimRep BCORep = "P_" -- not sure -- JRS 000708
+
+primRepString CharRep = "Char"
+primRepString Int8Rep = "Char" -- To have names like newCharArray#
+primRepString IntRep = "Int"
+primRepString WordRep = "Word"
+primRepString Int64Rep = "Int64"
+primRepString Word64Rep = "Word64"
+primRepString AddrRep = "Addr"
+primRepString FloatRep = "Float"
+primRepString DoubleRep = "Double"
+primRepString WeakPtrRep = "Weak"
+primRepString ForeignObjRep = "ForeignObj"
+primRepString StablePtrRep = "StablePtr"
+primRepString StableNameRep = "StableName"
+primRepString other = pprPanic "primRepString" (ppr other)
+
+showPrimRepToUser pr = primRepString pr