summaryrefslogtreecommitdiff
path: root/compiler/GHC/Cmm/Ppr/Expr.hs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/GHC/Cmm/Ppr/Expr.hs')
-rw-r--r--compiler/GHC/Cmm/Ppr/Expr.hs24
1 files changed, 12 insertions, 12 deletions
diff --git a/compiler/GHC/Cmm/Ppr/Expr.hs b/compiler/GHC/Cmm/Ppr/Expr.hs
index 4bb8021541..5b1d01b00a 100644
--- a/compiler/GHC/Cmm/Ppr/Expr.hs
+++ b/compiler/GHC/Cmm/Ppr/Expr.hs
@@ -41,7 +41,6 @@ where
import GHC.Prelude
-import GHC.Driver.Session (targetPlatform)
import GHC.Driver.Ppr
import GHC.Platform
@@ -54,16 +53,14 @@ import Numeric ( fromRat )
-----------------------------------------------------------------------------
-instance Outputable CmmExpr where
- ppr e = sdocWithDynFlags $ \dflags ->
- pprExpr (targetPlatform dflags) e
+instance OutputableP CmmExpr where
+ pdoc = pprExpr
instance Outputable CmmReg where
ppr e = pprReg e
-instance Outputable CmmLit where
- ppr l = sdocWithDynFlags $ \dflags ->
- pprLit (targetPlatform dflags) l
+instance OutputableP CmmLit where
+ pdoc = pprLit
instance Outputable LocalReg where
ppr e = pprLocalReg e
@@ -74,6 +71,9 @@ instance Outputable Area where
instance Outputable GlobalReg where
ppr e = pprGlobalReg e
+instance OutputableP GlobalReg where
+ pdoc _ = ppr
+
-- --------------------------------------------------------------------------
-- Expressions
--
@@ -147,7 +147,7 @@ pprExpr9 :: Platform -> CmmExpr -> SDoc
pprExpr9 platform e =
case e of
CmmLit lit -> pprLit1 platform lit
- CmmLoad expr rep -> ppr rep <> brackets (ppr expr)
+ CmmLoad expr rep -> ppr rep <> brackets (pdoc platform expr)
CmmReg reg -> ppr reg
CmmRegOff reg off -> parens (ppr reg <+> char '+' <+> int off)
CmmStackSlot a off -> parens (ppr a <+> char '+' <+> int off)
@@ -204,10 +204,10 @@ pprLit platform lit = case lit of
CmmFloat f rep -> hsep [ double (fromRat f), dcolon, ppr rep ]
CmmVec lits -> char '<' <> commafy (map (pprLit platform) lits) <> char '>'
- CmmLabel clbl -> ppr clbl
- CmmLabelOff clbl i -> ppr clbl <> ppr_offset i
- CmmLabelDiffOff clbl1 clbl2 i _ -> ppr clbl1 <> char '-'
- <> ppr clbl2 <> ppr_offset i
+ CmmLabel clbl -> pdoc platform clbl
+ CmmLabelOff clbl i -> pdoc platform clbl <> ppr_offset i
+ CmmLabelDiffOff clbl1 clbl2 i _ -> pdoc platform clbl1 <> char '-'
+ <> pdoc platform clbl2 <> ppr_offset i
CmmBlock id -> ppr id
CmmHighStackMark -> text "<highSp>"