summaryrefslogtreecommitdiff
path: root/compiler/GHC/StgToCmm
diff options
context:
space:
mode:
authorKrzysztof Gogolewski <krzysztof.gogolewski@tweag.io>2021-12-08 08:38:42 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-12-17 21:21:32 -0500
commit5d5620bc1001c6a0689c57c23272b398ae9937d1 (patch)
tree620615103d7894f69bd190fd0498c38c48325627 /compiler/GHC/StgToCmm
parent3c3e5c03c9890ba33bd2ac7239161738584dc473 (diff)
downloadhaskell-5d5620bc1001c6a0689c57c23272b398ae9937d1.tar.gz
Change isUnliftedTyCon to marshalablePrimTyCon (#20401)
isUnliftedTyCon was used in three places: Ticky, Template Haskell and FFI checks. It was straightforward to remove it from Ticky and Template Haskell. It is now used in FFI only and renamed to marshalablePrimTyCon. Previously, it was fetching information from a field in PrimTyCon called is_unlifted. Instead, I've changed the code to compute liftedness based on the kind. isFFITy and legalFFITyCon are removed. They were only referred from an old comment that I removed. There were three functions to define a PrimTyCon, but the only difference was that they were setting is_unlifted to True or False. Everything is now done in mkPrimTyCon. I also added missing integer types in Ticky.hs, I think it was an oversight. Fixes #20401
Diffstat (limited to 'compiler/GHC/StgToCmm')
-rw-r--r--compiler/GHC/StgToCmm/Ticky.hs21
1 files changed, 11 insertions, 10 deletions
diff --git a/compiler/GHC/StgToCmm/Ticky.hs b/compiler/GHC/StgToCmm/Ticky.hs
index 6a30bfff75..3aff61ac80 100644
--- a/compiler/GHC/StgToCmm/Ticky.hs
+++ b/compiler/GHC/StgToCmm/Ticky.hs
@@ -675,20 +675,21 @@ showTypeCategory ty
| otherwise = case tcSplitTyConApp_maybe ty of
Nothing -> '.'
Just (tycon, _) ->
- (if isUnliftedTyCon tycon then Data.Char.toLower else id) $
let anyOf us = getUnique tycon `elem` us in
case () of
_ | anyOf [funTyConKey] -> '>'
- | anyOf [charPrimTyConKey, charTyConKey] -> 'C'
- | anyOf [doublePrimTyConKey, doubleTyConKey] -> 'D'
- | anyOf [floatPrimTyConKey, floatTyConKey] -> 'F'
- | anyOf [intPrimTyConKey, int32PrimTyConKey, int64PrimTyConKey,
- intTyConKey, int8TyConKey, int16TyConKey, int32TyConKey, int64TyConKey
- ] -> 'I'
- | anyOf [wordPrimTyConKey, word32PrimTyConKey, word64PrimTyConKey, wordTyConKey,
- word8TyConKey, word16TyConKey, word32TyConKey, word64TyConKey
- ] -> 'W'
+ | anyOf [charTyConKey] -> 'C'
+ | anyOf [charPrimTyConKey] -> 'c'
+ | anyOf [doubleTyConKey] -> 'D'
+ | anyOf [doublePrimTyConKey] -> 'd'
+ | anyOf [floatTyConKey] -> 'F'
+ | anyOf [floatPrimTyConKey] -> 'f'
+ | anyOf [intTyConKey, int8TyConKey, int16TyConKey, int32TyConKey, int64TyConKey] -> 'I'
+ | anyOf [intPrimTyConKey, int8PrimTyConKey, int16PrimTyConKey, int32PrimTyConKey, int64PrimTyConKey] -> 'i'
+ | anyOf [wordTyConKey, word8TyConKey, word16TyConKey, word32TyConKey, word64TyConKey] -> 'W'
+ | anyOf [wordPrimTyConKey, word8PrimTyConKey, word16PrimTyConKey, word32PrimTyConKey, word64PrimTyConKey] -> 'w'
| anyOf [listTyConKey] -> 'L'
+ | isUnboxedTupleTyCon tycon -> 't'
| isTupleTyCon tycon -> 'T'
| isPrimTyCon tycon -> 'P'
| isEnumerationTyCon tycon -> 'E'