summaryrefslogtreecommitdiff
path: root/compiler/GHC/Cmm/Node.hs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/GHC/Cmm/Node.hs')
-rw-r--r--compiler/GHC/Cmm/Node.hs22
1 files changed, 10 insertions, 12 deletions
diff --git a/compiler/GHC/Cmm/Node.hs b/compiler/GHC/Cmm/Node.hs
index 01db60b116..9e5b709385 100644
--- a/compiler/GHC/Cmm/Node.hs
+++ b/compiler/GHC/Cmm/Node.hs
@@ -31,7 +31,6 @@ import GHC.Prelude hiding (succ)
import GHC.Platform.Regs
import GHC.Cmm.Expr
import GHC.Cmm.Switch
-import GHC.Driver.Session
import GHC.Data.FastString
import GHC.Types.ForeignCall
import GHC.Utils.Outputable
@@ -320,7 +319,7 @@ foreignTargetHints target
-- Instances of register and slot users / definers
instance UserOfRegs LocalReg (CmmNode e x) where
- foldRegsUsed dflags f !z n = case n of
+ foldRegsUsed platform f !z n = case n of
CmmAssign _ expr -> fold f z expr
CmmStore addr rval -> fold f (fold f z addr) rval
CmmUnsafeForeignCall t _ args -> fold f (fold f z t) args
@@ -331,10 +330,10 @@ instance UserOfRegs LocalReg (CmmNode e x) where
_ -> z
where fold :: forall a b. UserOfRegs LocalReg a
=> (b -> LocalReg -> b) -> b -> a -> b
- fold f z n = foldRegsUsed dflags f z n
+ fold f z n = foldRegsUsed platform f z n
instance UserOfRegs GlobalReg (CmmNode e x) where
- foldRegsUsed dflags f !z n = case n of
+ foldRegsUsed platform f !z n = case n of
CmmAssign _ expr -> fold f z expr
CmmStore addr rval -> fold f (fold f z addr) rval
CmmUnsafeForeignCall t _ args -> fold f (fold f z t) args
@@ -345,26 +344,26 @@ instance UserOfRegs GlobalReg (CmmNode e x) where
_ -> z
where fold :: forall a b. UserOfRegs GlobalReg a
=> (b -> GlobalReg -> b) -> b -> a -> b
- fold f z n = foldRegsUsed dflags f z n
+ fold f z n = foldRegsUsed platform f z n
instance (Ord r, UserOfRegs r CmmReg) => UserOfRegs r ForeignTarget where
-- The (Ord r) in the context is necessary here
-- See Note [Recursive superclasses] in GHC.Tc.TyCl.Instance
- foldRegsUsed _ _ !z (PrimTarget _) = z
- foldRegsUsed dflags f !z (ForeignTarget e _) = foldRegsUsed dflags f z e
+ foldRegsUsed _ _ !z (PrimTarget _) = z
+ foldRegsUsed platform f !z (ForeignTarget e _) = foldRegsUsed platform f z e
instance DefinerOfRegs LocalReg (CmmNode e x) where
- foldRegsDefd dflags f !z n = case n of
+ foldRegsDefd platform f !z n = case n of
CmmAssign lhs _ -> fold f z lhs
CmmUnsafeForeignCall _ fs _ -> fold f z fs
CmmForeignCall {res=res} -> fold f z res
_ -> z
where fold :: forall a b. DefinerOfRegs LocalReg a
=> (b -> LocalReg -> b) -> b -> a -> b
- fold f z n = foldRegsDefd dflags f z n
+ fold f z n = foldRegsDefd platform f z n
instance DefinerOfRegs GlobalReg (CmmNode e x) where
- foldRegsDefd dflags f !z n = case n of
+ foldRegsDefd platform f !z n = case n of
CmmAssign lhs _ -> fold f z lhs
CmmUnsafeForeignCall tgt _ _ -> fold f z (foreignTargetRegs tgt)
CmmCall {} -> fold f z activeRegs
@@ -373,9 +372,8 @@ instance DefinerOfRegs GlobalReg (CmmNode e x) where
_ -> z
where fold :: forall a b. DefinerOfRegs GlobalReg a
=> (b -> GlobalReg -> b) -> b -> a -> b
- fold f z n = foldRegsDefd dflags f z n
+ fold f z n = foldRegsDefd platform f z n
- platform = targetPlatform dflags
activeRegs = activeStgRegs platform
activeCallerSavesRegs = filter (callerSaves platform) activeRegs