summaryrefslogtreecommitdiff
path: root/compiler/GHC/Cmm/Info/Build.hs
diff options
context:
space:
mode:
authorM Farkas-Dyck <strake888@proton.me>2022-09-16 23:45:24 -0800
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-12-20 21:14:46 -0500
commit703a466511307c5737d371898f9771991a0a31cc (patch)
tree5654cf13c50795284598939741de84575994841a /compiler/GHC/Cmm/Info/Build.hs
parent5e047effac9228f3bdddb66c9056e86621ccbec8 (diff)
downloadhaskell-703a466511307c5737d371898f9771991a0a31cc.tar.gz
Scrub some partiality in `GHC.Cmm.Info.Build`: `doSRTs` takes a `[(CAFSet, CmmDecl)]` but truly wants a `[(CAFSet, CmmStatics)]`.
Diffstat (limited to 'compiler/GHC/Cmm/Info/Build.hs')
-rw-r--r--compiler/GHC/Cmm/Info/Build.hs12
1 files changed, 5 insertions, 7 deletions
diff --git a/compiler/GHC/Cmm/Info/Build.hs b/compiler/GHC/Cmm/Info/Build.hs
index e363eb879d..16745151a4 100644
--- a/compiler/GHC/Cmm/Info/Build.hs
+++ b/compiler/GHC/Cmm/Info/Build.hs
@@ -1,6 +1,6 @@
{-# LANGUAGE GADTs, BangPatterns, RecordWildCards,
GeneralizedNewtypeDeriving, NondecreasingIndentation, TupleSections,
- ScopedTypeVariables, OverloadedStrings, LambdaCase #-}
+ ScopedTypeVariables, OverloadedStrings, LambdaCase, EmptyCase #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE StandaloneDeriving #-}
@@ -884,7 +884,7 @@ doSRTs
:: CmmConfig
-> ModuleSRTInfo
-> [(CAFEnv, [CmmDecl])] -- ^ 'CAFEnv's and 'CmmDecl's for code blocks
- -> [(CAFSet, CmmDecl)] -- ^ static data decls and their 'CAFSet's
+ -> [(CAFSet, CmmDataDecl)] -- ^ static data decls and their 'CAFSet's
-> IO (ModuleSRTInfo, [CmmDeclSRTs])
doSRTs cfg moduleSRTInfo procs data_ = do
@@ -900,8 +900,7 @@ doSRTs cfg moduleSRTInfo procs data_ = do
flip map data_ $
\(set, decl) ->
case decl of
- CmmProc{} ->
- pprPanic "doSRTs" (text "Proc in static data list:" <+> pdoc platform decl)
+ CmmProc void _ _ _ -> case void of
CmmData _ static ->
case static of
CmmStatics lbl _ _ _ _ -> (lbl, set)
@@ -909,7 +908,7 @@ doSRTs cfg moduleSRTInfo procs data_ = do
(proc_envs, procss) = unzip procs
cafEnv = mapUnions proc_envs
- decls = map snd data_ ++ concat procss
+ decls = map (cmmDataDeclCmmDecl . snd) data_ ++ concat procss
staticFuns = mapFromList (getStaticFuns decls)
platform = cmmPlatform cfg
@@ -980,8 +979,7 @@ doSRTs cfg moduleSRTInfo procs data_ = do
| otherwise ->
-- Not an IdLabel, ignore
srtMap
- CmmProc{} ->
- pprPanic "doSRTs" (text "Found Proc in static data list:" <+> pdoc platform decl))
+ CmmProc void _ _ _ -> case void of)
(moduleSRTMap moduleSRTInfo') data_
return (moduleSRTInfo'{ moduleSRTMap = srtMap_w_raws }, srt_decls ++ decls')