diff options
author | Luite Stegeman <stegeman@gmail.com> | 2021-05-03 19:15:28 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-05-05 05:45:03 -0400 |
commit | 3280eb2216b44d46813fe8e026ebdfc9ac0547a9 (patch) | |
tree | fe0ded5d68f510e78e6ec34b4af4f4c33155ce7e /compiler/GHC/StgToByteCode.hs | |
parent | f464e4777662a25c0b241d396146ba7a3182b9f3 (diff) | |
download | haskell-3280eb2216b44d46813fe8e026ebdfc9ac0547a9.tar.gz |
support LiftedRep and UnliftedRep in GHCi FFI
fixes #19733
Diffstat (limited to 'compiler/GHC/StgToByteCode.hs')
-rw-r--r-- | compiler/GHC/StgToByteCode.hs | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/compiler/GHC/StgToByteCode.hs b/compiler/GHC/StgToByteCode.hs index 04eb52d7c0..787c0ad155 100644 --- a/compiler/GHC/StgToByteCode.hs +++ b/compiler/GHC/StgToByteCode.hs @@ -1645,7 +1645,9 @@ primRepToFFIType platform r AddrRep -> FFIPointer FloatRep -> FFIFloat DoubleRep -> FFIDouble - _ -> panic "primRepToFFIType" + LiftedRep -> FFIPointer + UnliftedRep -> FFIPointer + _ -> pprPanic "primRepToFFIType" (ppr r) where (signed_word, unsigned_word) = case platformWordSize platform of PW4 -> (FFISInt32, FFIUInt32) @@ -1656,19 +1658,21 @@ primRepToFFIType platform r mkDummyLiteral :: Platform -> PrimRep -> Literal mkDummyLiteral platform pr = case pr of - IntRep -> mkLitInt platform 0 - WordRep -> mkLitWord platform 0 - Int8Rep -> mkLitInt8 0 - Word8Rep -> mkLitWord8 0 - Int16Rep -> mkLitInt16 0 - Word16Rep -> mkLitWord16 0 - Int32Rep -> mkLitInt32 0 - Word32Rep -> mkLitWord32 0 - Int64Rep -> mkLitInt64 0 - Word64Rep -> mkLitWord64 0 - AddrRep -> LitNullAddr - DoubleRep -> LitDouble 0 - FloatRep -> LitFloat 0 + IntRep -> mkLitInt platform 0 + WordRep -> mkLitWord platform 0 + Int8Rep -> mkLitInt8 0 + Word8Rep -> mkLitWord8 0 + Int16Rep -> mkLitInt16 0 + Word16Rep -> mkLitWord16 0 + Int32Rep -> mkLitInt32 0 + Word32Rep -> mkLitWord32 0 + Int64Rep -> mkLitInt64 0 + Word64Rep -> mkLitWord64 0 + AddrRep -> LitNullAddr + DoubleRep -> LitDouble 0 + FloatRep -> LitFloat 0 + LiftedRep -> LitNullAddr + UnliftedRep -> LitNullAddr _ -> pprPanic "mkDummyLiteral" (ppr pr) @@ -1699,9 +1703,7 @@ maybe_getCCallReturnRep fn_ty case r_reps of [] -> panic "empty typePrimRepArgs" [VoidRep] -> Nothing - [rep] - | isGcPtrRep rep -> blargh - | otherwise -> Just rep + [rep] -> Just rep -- if it was, it would be impossible to create a -- valid return value placeholder on the stack |