summaryrefslogtreecommitdiff
path: root/compiler/GHC/Cmm/Info/Build.hs
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2020-03-29 14:34:54 +0000
committerBen Gamari <ben@smart-cactus.org>2020-05-10 15:01:01 -0400
commit0edf15e8092033c5f74f37308489a49a4e00ce3e (patch)
tree80c7581057361b42eb2a26f5ca99fce4adc5b126 /compiler/GHC/Cmm/Info/Build.hs
parent86c77b36628dcce7bc9b066fc24c8c521fecc3ee (diff)
downloadhaskell-wip/caf-cleanups.tar.gz
Add few cleanups of the CAF logicwip/caf-cleanups
Give the NameSet of non-CAFfy names a proper newtype to distinguish it from all of the other NameSets floating about.
Diffstat (limited to 'compiler/GHC/Cmm/Info/Build.hs')
-rw-r--r--compiler/GHC/Cmm/Info/Build.hs11
1 files changed, 6 insertions, 5 deletions
diff --git a/compiler/GHC/Cmm/Info/Build.hs b/compiler/GHC/Cmm/Info/Build.hs
index 6eabd638b9..fc3d21e2ca 100644
--- a/compiler/GHC/Cmm/Info/Build.hs
+++ b/compiler/GHC/Cmm/Info/Build.hs
@@ -459,7 +459,7 @@ type CAFSet = Set CAFLabel
type CAFEnv = LabelMap CAFSet
mkCAFLabel :: CLabel -> CAFLabel
-mkCAFLabel lbl = CAFLabel $! toClosureLbl lbl
+mkCAFLabel lbl = CAFLabel (toClosureLbl lbl)
-- This is a label that we can put in an SRT. It *must* be a closure label,
-- pointing to either a FUN_STATIC, THUNK_STATIC, or CONSTR.
@@ -736,10 +736,11 @@ getStaticFuns decls =
type SRTMap = Map CAFLabel (Maybe SRTEntry)
--- | Given SRTMap of a module returns the set of non-CAFFY names in the module.
--- Any Names not in the set are CAFFY.
-srtMapNonCAFs :: SRTMap -> NameSet
-srtMapNonCAFs srtMap = mkNameSet (mapMaybe get_name (Map.toList srtMap))
+-- | Given 'SRTMap' of a module, returns the set of non-CAFFY names in the
+-- module. Any 'Name's not in the set are CAFFY.
+srtMapNonCAFs :: SRTMap -> NonCaffySet
+srtMapNonCAFs srtMap =
+ NonCaffySet $ mkNameSet (mapMaybe get_name (Map.toList srtMap))
where
get_name (CAFLabel l, Nothing) = hasHaskellName l
get_name (_l, Just _srt_entry) = Nothing