summaryrefslogtreecommitdiff
path: root/compiler/GHC/StgToCmm
diff options
context:
space:
mode:
authorAndreas Klebinger <klebinger.andreas@gmx.at>2022-02-25 14:51:47 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-02-28 19:17:12 -0500
commit4f0208e53444d32c7f3795b3ac15acbfc75bf58c (patch)
treed06a70f2bd3b00503ba87666fcbe12cc525aa462 /compiler/GHC/StgToCmm
parentadfddf7de3a9c1f757cbf027815a4b4f6ee86a7e (diff)
downloadhaskell-4f0208e53444d32c7f3795b3ac15acbfc75bf58c.tar.gz
CLabel cleanup:
Remove these smart constructors for these reasons: * mkLocalClosureTableLabel : Does the same as the non-local variant. * mkLocalClosureLabel : Does the same as the non-local variant. * mkLocalInfoTableLabel : Decide if we make a local label based on the name and just use mkInfoTableLabel everywhere.
Diffstat (limited to 'compiler/GHC/StgToCmm')
-rw-r--r--compiler/GHC/StgToCmm/Bind.hs2
-rw-r--r--compiler/GHC/StgToCmm/Closure.hs13
2 files changed, 3 insertions, 12 deletions
diff --git a/compiler/GHC/StgToCmm/Bind.hs b/compiler/GHC/StgToCmm/Bind.hs
index 25d04b323c..17d8556b15 100644
--- a/compiler/GHC/StgToCmm/Bind.hs
+++ b/compiler/GHC/StgToCmm/Bind.hs
@@ -81,7 +81,7 @@ cgTopRhsClosure :: Platform
-> (CgIdInfo, FCode ())
cgTopRhsClosure platform rec id ccs upd_flag args body =
- let closure_label = mkLocalClosureLabel (idName id) (idCafInfo id)
+ let closure_label = mkClosureLabel (idName id) (idCafInfo id)
cg_id_info = litIdInfo platform id lf_info (CmmLabel closure_label)
lf_info = mkClosureLFInfo platform id TopLevel [] upd_flag args
in (cg_id_info, gen_code lf_info closure_label)
diff --git a/compiler/GHC/StgToCmm/Closure.hs b/compiler/GHC/StgToCmm/Closure.hs
index 0d048a6be8..2609606292 100644
--- a/compiler/GHC/StgToCmm/Closure.hs
+++ b/compiler/GHC/StgToCmm/Closure.hs
@@ -848,23 +848,14 @@ mkClosureInfoTableLabel platform id lf_info
LFThunk _ _ upd_flag (ApThunk arity) _
-> mkApInfoTableLabel platform upd_flag arity
- LFThunk{} -> std_mk_lbl name cafs
- LFReEntrant{} -> std_mk_lbl name cafs
+ LFThunk{} -> mkInfoTableLabel name cafs
+ LFReEntrant{} -> mkInfoTableLabel name cafs
_other -> panic "closureInfoTableLabel"
where
name = idName id
- std_mk_lbl | is_local = mkLocalInfoTableLabel
- | otherwise = mkInfoTableLabel
-
cafs = idCafInfo id
- is_local = isDataConWorkId id
- -- Make the _info pointer for the implicit datacon worker
- -- binding local. The reason we can do this is that importing
- -- code always either uses the _closure or _con_info. By the
- -- invariants in "GHC.CoreToStg.Prep" anything else gets eta expanded.
-
-- | thunkEntryLabel is a local help function, not exported. It's used from
-- getCallMethod.