summaryrefslogtreecommitdiff
path: root/compiler/GHC/Core/Make.hs
diff options
context:
space:
mode:
authorMadeline Haraj <madeline.haraj@obsidian.systems>2020-09-25 12:40:08 -0400
committerAndreas Klebinger <klebinger.andreas@gmx.at>2022-11-14 22:44:17 +0000
commit2b7d5ccc4a022abfba3a6774639d30738a94ae85 (patch)
tree4a218879fb7d23e9afa3c10dfd84c08ee6831eac /compiler/GHC/Core/Make.hs
parent8f6c576b0b9b82acf23c51ae8cb3c6e5bde61ab4 (diff)
downloadhaskell-2b7d5ccc4a022abfba3a6774639d30738a94ae85.tar.gz
Implement UNPACK support for sum types.
This is based on osa's unpack_sums PR from ages past. The meat of the patch is implemented in dataConArgUnpackSum and described in Note [UNPACK for sum types].
Diffstat (limited to 'compiler/GHC/Core/Make.hs')
-rw-r--r--compiler/GHC/Core/Make.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/GHC/Core/Make.hs b/compiler/GHC/Core/Make.hs
index c2fff4596c..08d08b5008 100644
--- a/compiler/GHC/Core/Make.hs
+++ b/compiler/GHC/Core/Make.hs
@@ -23,7 +23,7 @@ module GHC.Core.Make (
FloatBind(..), wrapFloat, wrapFloats, floatBindings,
-- * Constructing small tuples
- mkCoreVarTupTy, mkCoreTup, mkCoreUnboxedTuple, mkCoreUbxSum,
+ mkCoreVarTupTy, mkCoreTup, mkCoreUnboxedTuple, mkCoreUnboxedSum,
mkCoreTupBoxity, unitExpr,
-- * Constructing big tuples
@@ -405,8 +405,8 @@ mkCoreTup cs = mkCoreBoxedTuple cs -- non-1-tuples are uniform
-- | Build an unboxed sum.
--
-- Alternative number ("alt") starts from 1.
-mkCoreUbxSum :: Int -> Int -> [Type] -> CoreExpr -> CoreExpr
-mkCoreUbxSum arity alt tys exp
+mkCoreUnboxedSum :: Int -> Int -> [Type] -> CoreExpr -> CoreExpr
+mkCoreUnboxedSum arity alt tys exp
= assert (length tys == arity) $
assert (alt <= arity) $
mkCoreConApps (sumDataCon alt arity)