summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Klebinger <klebinger.andreas@gmx.at>2021-11-17 14:03:56 +0100
committerAndreas Klebinger <klebinger.andreas@gmx.at>2021-11-17 14:03:56 +0100
commit6fd720c0df656537498b40b5057087b6fb1e4832 (patch)
treec74e4361649e4c84e4af584f76a8a8d1ff5dff95
parent16d86b97ee3056b54441e7dfd349477f32347a26 (diff)
downloadhaskell-6fd720c0df656537498b40b5057087b6fb1e4832.tar.gz
Put RunUniqSMIO into proper module
-rw-r--r--compiler/GHC/Cmm/Pipeline.hs14
-rw-r--r--compiler/GHC/Types/Unique/Supply.hs10
2 files changed, 12 insertions, 12 deletions
diff --git a/compiler/GHC/Cmm/Pipeline.hs b/compiler/GHC/Cmm/Pipeline.hs
index 481f2bb545..ff61a2a7a4 100644
--- a/compiler/GHC/Cmm/Pipeline.hs
+++ b/compiler/GHC/Cmm/Pipeline.hs
@@ -84,7 +84,7 @@ cpsTop logger platform dflags proc =
----------- Implement switches ------------------------------------------
g <- {-# SCC "createSwitchPlans" #-}
- runUniqSM $ cmmImplementSwitchPlans (backend dflags) platform g
+ runUniqSMIO $ cmmImplementSwitchPlans (backend dflags) platform g
dump Opt_D_dump_cmm_switch "Post switch plan" g
----------- Proc points -------------------------------------------------
@@ -94,7 +94,7 @@ cpsTop logger platform dflags proc =
proc_points <-
if splitting_proc_points
then do
- pp <- {-# SCC "minimalProcPointSet" #-} runUniqSM $
+ pp <- {-# SCC "minimalProcPointSet" #-} runUniqSMIO $
minimalProcPointSet platform call_pps g
dumpWith logger Opt_D_dump_cmm_proc "Proc points"
FormatCMM (pdoc platform l $$ ppr pp $$ pdoc platform g)
@@ -106,7 +106,7 @@ cpsTop logger platform dflags proc =
(g, stackmaps) <-
{-# SCC "layoutStack" #-}
if do_layout
- then runUniqSM $ cmmLayoutStack dflags proc_points entry_off g
+ then runUniqSMIO $ cmmLayoutStack dflags proc_points entry_off g
else return (g, mapEmpty)
dump Opt_D_dump_cmm_sp "Layout Stack" g
@@ -126,7 +126,7 @@ cpsTop logger platform dflags proc =
procPointAnalysis proc_points g
dumpWith logger Opt_D_dump_cmm_procmap "procpoint map"
FormatCMM (ppr pp_map)
- g <- {-# SCC "splitAtProcPoints" #-} runUniqSM $
+ g <- {-# SCC "splitAtProcPoints" #-} runUniqSMIO $
splitAtProcPoints platform l call_pps proc_points pp_map
(CmmProc h l v g)
dumps Opt_D_dump_cmm_split "Post splitting" g
@@ -341,12 +341,6 @@ generator later.
-}
-runUniqSM :: UniqSM a -> IO a
-runUniqSM m = do
- us <- mkSplitUniqSupply 'u'
- return (initUs_ us m)
-
-
dumpGraph :: Logger -> Platform -> DynFlags -> DumpFlag -> String -> CmmGraph -> IO ()
dumpGraph logger platform dflags flag name g = do
when (gopt Opt_DoCmmLinting dflags) $ do_lint g
diff --git a/compiler/GHC/Types/Unique/Supply.hs b/compiler/GHC/Types/Unique/Supply.hs
index 57dd8e10ab..fb2dbf62f6 100644
--- a/compiler/GHC/Types/Unique/Supply.hs
+++ b/compiler/GHC/Types/Unique/Supply.hs
@@ -24,11 +24,12 @@ module GHC.Types.Unique.Supply (
UniqSM, MonadUnique(..),
-- ** Operations on the monad
- initUs, initUs_,
+ initUs, initUs_, runUniqSMIO,
-- * Set supply strategy
initUniqSupply
- ) where
+ )
+ where
import GHC.Prelude
@@ -221,6 +222,11 @@ mkSplitUniqSupply c
(# s4, MkSplitUniqSupply (mask .|. u) x y #)
}}}}
+runUniqSMIO :: UniqSM a -> IO a
+runUniqSMIO m = do
+ us <- mkSplitUniqSupply 'u'
+ return (initUs_ us m)
+
#if !MIN_VERSION_GLASGOW_HASKELL(9,1,0,0)
foreign import ccall unsafe "genSym" genSym :: IO Int
#else