summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2022-06-29 23:13:23 -0400
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-07-16 13:25:41 -0400
commitf2e5e7631ffafe3225989f8b67646c833c00e3ec (patch)
tree3247f8b9d07bf0985ea7faab1f7cf62bfba8d908
parentf1c449910256c61cb35e361a367d5209bc51cc7a (diff)
downloadhaskell-f2e5e7631ffafe3225989f8b67646c833c00e3ec.tar.gz
cmm: Move toBlockList to GHC.Cmm
-rw-r--r--compiler/GHC/Cmm.hs6
-rw-r--r--compiler/GHC/Cmm/Expr.hs1
-rw-r--r--compiler/GHC/Cmm/Lint.hs1
-rw-r--r--compiler/GHC/Cmm/Utils.hs3
-rw-r--r--compiler/GHC/CmmToAsm/CFG.hs1
-rw-r--r--compiler/GHC/Driver/GenerateCgIPEStub.hs1
6 files changed, 5 insertions, 8 deletions
diff --git a/compiler/GHC/Cmm.hs b/compiler/GHC/Cmm.hs
index 797940c5a2..a369654c4d 100644
--- a/compiler/GHC/Cmm.hs
+++ b/compiler/GHC/Cmm.hs
@@ -12,7 +12,8 @@ module GHC.Cmm (
-- * Cmm top-level datatypes
CmmProgram, CmmGroup, CmmGroupSRTs, RawCmmGroup, GenCmmGroup,
CmmDecl, CmmDeclSRTs, GenCmmDecl(..),
- CmmGraph, GenCmmGraph(..), toBlockMap, revPostorder,
+ CmmGraph, GenCmmGraph(..),
+ toBlockMap, revPostorder, toBlockList,
CmmBlock, RawCmmDecl,
Section(..), SectionType(..),
GenCmmStatics(..), type CmmStatics, type RawCmmStatics, CmmStatic(..),
@@ -150,6 +151,9 @@ revPostorder :: CmmGraph -> [CmmBlock]
revPostorder g = {-# SCC "revPostorder" #-}
revPostorderFrom (toBlockMap g) (g_entry g)
+toBlockList :: CmmGraph -> [CmmBlock]
+toBlockList g = mapElems $ toBlockMap g
+
-----------------------------------------------------------------------------
-- Info Tables
-----------------------------------------------------------------------------
diff --git a/compiler/GHC/Cmm/Expr.hs b/compiler/GHC/Cmm/Expr.hs
index ccc94a8b92..212316b68d 100644
--- a/compiler/GHC/Cmm/Expr.hs
+++ b/compiler/GHC/Cmm/Expr.hs
@@ -49,7 +49,6 @@ import GHC.Cmm.Reg
import GHC.Utils.Trace (pprTrace)
import GHC.Utils.Panic (panic)
import GHC.Utils.Outputable
-import GHC.Types.Unique
import Data.Maybe
import Data.Set (Set)
diff --git a/compiler/GHC/Cmm/Lint.hs b/compiler/GHC/Cmm/Lint.hs
index f1d60c133b..ec81099223 100644
--- a/compiler/GHC/Cmm/Lint.hs
+++ b/compiler/GHC/Cmm/Lint.hs
@@ -21,7 +21,6 @@ import GHC.Cmm.Dataflow.Collections
import GHC.Cmm.Dataflow.Graph
import GHC.Cmm.Dataflow.Label
import GHC.Cmm
-import GHC.Cmm.Utils
import GHC.Cmm.Liveness
import GHC.Cmm.Switch (switchTargetsToList)
import GHC.Utils.Outputable
diff --git a/compiler/GHC/Cmm/Utils.hs b/compiler/GHC/Cmm/Utils.hs
index fda3ee23f6..3671366d07 100644
--- a/compiler/GHC/Cmm/Utils.hs
+++ b/compiler/GHC/Cmm/Utils.hs
@@ -496,9 +496,6 @@ modifyGraph f g = CmmGraph {g_entry=g_entry g, g_graph=f (g_graph g)}
ofBlockMap :: BlockId -> LabelMap CmmBlock -> CmmGraph
ofBlockMap entry bodyMap = CmmGraph {g_entry=entry, g_graph=GMany NothingO bodyMap NothingO}
-toBlockList :: CmmGraph -> [CmmBlock]
-toBlockList g = mapElems $ toBlockMap g
-
-- | like 'toBlockList', but the entry block always comes first
toBlockListEntryFirst :: CmmGraph -> [CmmBlock]
toBlockListEntryFirst g
diff --git a/compiler/GHC/CmmToAsm/CFG.hs b/compiler/GHC/CmmToAsm/CFG.hs
index 2d8caefcc5..8a8907e6b4 100644
--- a/compiler/GHC/CmmToAsm/CFG.hs
+++ b/compiler/GHC/CmmToAsm/CFG.hs
@@ -47,7 +47,6 @@ import GHC.Platform
import GHC.Cmm.BlockId
import GHC.Cmm as Cmm
-import GHC.Cmm.Utils
import GHC.Cmm.Switch
import GHC.Cmm.Dataflow.Collections
import GHC.Cmm.Dataflow.Label
diff --git a/compiler/GHC/Driver/GenerateCgIPEStub.hs b/compiler/GHC/Driver/GenerateCgIPEStub.hs
index cf6538ef3e..6f5de8af4a 100644
--- a/compiler/GHC/Driver/GenerateCgIPEStub.hs
+++ b/compiler/GHC/Driver/GenerateCgIPEStub.hs
@@ -12,7 +12,6 @@ import GHC.Cmm.Dataflow.Collections (mapToList)
import GHC.Cmm.Dataflow.Label (Label)
import GHC.Cmm.Info.Build (emptySRT)
import GHC.Cmm.Pipeline (cmmPipeline)
-import GHC.Cmm.Utils (toBlockList)
import GHC.Data.Maybe (firstJusts)
import GHC.Data.Stream (Stream, liftIO)
import qualified GHC.Data.Stream as Stream