summaryrefslogtreecommitdiff
path: root/compiler/GHC/Cmm/CLabel.hs
diff options
context:
space:
mode:
authorAndreas Klebinger <klebinger.andreas@gmx.at>2022-02-25 14:51:47 +0100
committerAndreas Klebinger <klebinger.andreas@gmx.at>2022-02-28 11:10:39 +0100
commit1f7f40d9a4e59848a0ebf5171f470c39fc506485 (patch)
tree2b04e7c9599bc24379b2a595357242d6d67d93f3 /compiler/GHC/Cmm/CLabel.hs
parent0a80b43641c0b66ecdc6cf1d3ae08b002a0f270f (diff)
downloadhaskell-1f7f40d9a4e59848a0ebf5171f470c39fc506485.tar.gz
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/Cmm/CLabel.hs')
-rw-r--r--compiler/GHC/Cmm/CLabel.hs16
1 files changed, 4 insertions, 12 deletions
diff --git a/compiler/GHC/Cmm/CLabel.hs b/compiler/GHC/Cmm/CLabel.hs
index dd7e1f14f5..933151a679 100644
--- a/compiler/GHC/Cmm/CLabel.hs
+++ b/compiler/GHC/Cmm/CLabel.hs
@@ -33,9 +33,6 @@ module GHC.Cmm.CLabel (
mkBytesLabel,
mkLocalBlockLabel,
- mkLocalClosureLabel,
- mkLocalInfoTableLabel,
- mkLocalClosureTableLabel,
mkBlockInfoTableLabel,
@@ -587,14 +584,6 @@ mkRednCountsLabel name = IdLabel name NoCafRefs (IdTickyInfo TickyRednCounts)
mkTagHitLabel :: Name -> Unique -> CLabel
mkTagHitLabel name !uniq = IdLabel name NoCafRefs (IdTickyInfo (TickyInferedTag uniq))
--- These have local & (possibly) external variants:
-mkLocalClosureLabel :: Name -> CafInfo -> CLabel
-mkLocalInfoTableLabel :: Name -> CafInfo -> CLabel
-mkLocalClosureTableLabel :: Name -> CafInfo -> CLabel
-mkLocalClosureLabel !name !c = IdLabel name c Closure
-mkLocalInfoTableLabel name c = IdLabel name c LocalInfoTable
-mkLocalClosureTableLabel name c = IdLabel name c ClosureTable
-
mkClosureLabel :: Name -> CafInfo -> CLabel
mkInfoTableLabel :: Name -> CafInfo -> CLabel
mkEntryLabel :: Name -> CafInfo -> CLabel
@@ -602,7 +591,10 @@ mkClosureTableLabel :: Name -> CafInfo -> CLabel
mkConInfoTableLabel :: Name -> ConInfoTableLocation -> CLabel
mkBytesLabel :: Name -> CLabel
mkClosureLabel name c = IdLabel name c Closure
-mkInfoTableLabel name c = IdLabel name c InfoTable
+-- | Decicdes between external and local labels based on the names externality.
+mkInfoTableLabel name c
+ | isExternalName name = IdLabel name c InfoTable
+ | otherwise = IdLabel name c LocalInfoTable
mkEntryLabel name c = IdLabel name c Entry
mkClosureTableLabel name c = IdLabel name c ClosureTable
-- Special case for the normal 'DefinitionSite' case so that the 'ConInfoTable' application can be floated to a CAF.