summaryrefslogtreecommitdiff
path: root/compiler/GHC/CmmToAsm/PPC
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/GHC/CmmToAsm/PPC')
-rw-r--r--compiler/GHC/CmmToAsm/PPC/CodeGen.hs2
-rw-r--r--compiler/GHC/CmmToAsm/PPC/Instr.hs5
-rw-r--r--compiler/GHC/CmmToAsm/PPC/Ppr.hs16
3 files changed, 11 insertions, 12 deletions
diff --git a/compiler/GHC/CmmToAsm/PPC/CodeGen.hs b/compiler/GHC/CmmToAsm/PPC/CodeGen.hs
index 1c3b244980..2184c0fc29 100644
--- a/compiler/GHC/CmmToAsm/PPC/CodeGen.hs
+++ b/compiler/GHC/CmmToAsm/PPC/CodeGen.hs
@@ -162,7 +162,7 @@ stmtToInstrs stmt = do
config <- getConfig
platform <- getPlatform
case stmt of
- CmmComment s -> return (unitOL (COMMENT s))
+ CmmComment s -> return (unitOL (COMMENT $ ftext s))
CmmTick {} -> return nilOL
CmmUnwind {} -> return nilOL
diff --git a/compiler/GHC/CmmToAsm/PPC/Instr.hs b/compiler/GHC/CmmToAsm/PPC/Instr.hs
index 54a73f24a9..2f99528498 100644
--- a/compiler/GHC/CmmToAsm/PPC/Instr.hs
+++ b/compiler/GHC/CmmToAsm/PPC/Instr.hs
@@ -51,8 +51,8 @@ import GHC.Cmm.Dataflow.Collections
import GHC.Cmm.Dataflow.Label
import GHC.Cmm
import GHC.Cmm.Info
-import GHC.Data.FastString
import GHC.Cmm.CLabel
+import GHC.Utils.Outputable
import GHC.Utils.Panic
import GHC.Platform
import GHC.Types.Unique.FM (listToUFM, lookupUFM)
@@ -61,6 +61,7 @@ import GHC.Types.Unique.Supply
import Control.Monad (replicateM)
import Data.Maybe (fromMaybe)
+
--------------------------------------------------------------------------------
-- Format of a PPC memory address.
--
@@ -177,7 +178,7 @@ data RI
data Instr
-- comment pseudo-op
- = COMMENT FastString
+ = COMMENT SDoc
-- location pseudo-op (file, line, col, name)
| LOCATION Int Int Int String
diff --git a/compiler/GHC/CmmToAsm/PPC/Ppr.hs b/compiler/GHC/CmmToAsm/PPC/Ppr.hs
index 336e0d1804..05217768fc 100644
--- a/compiler/GHC/CmmToAsm/PPC/Ppr.hs
+++ b/compiler/GHC/CmmToAsm/PPC/Ppr.hs
@@ -38,7 +38,6 @@ import GHC.Cmm.Ppr.Expr () -- For Outputable instances
import GHC.Types.Unique ( pprUniqueAlways, getUnique )
import GHC.Platform
-import GHC.Data.FastString
import GHC.Utils.Outputable
import GHC.Utils.Panic
@@ -335,22 +334,21 @@ pprDataItem platform lit
= panic "PPC.Ppr.pprDataItem: no match"
+asmComment :: SDoc -> SDoc
+asmComment c = whenPprDebug $ text "#" <+> c
+
+
pprInstr :: Platform -> Instr -> SDoc
pprInstr platform instr = case instr of
- COMMENT _
- -> empty -- nuke 'em
-
- -- COMMENT s
- -- -> if platformOS platform == OSLinux
- -- then text "# " <> ftext s
- -- else text "; " <> ftext s
+ COMMENT s
+ -> asmComment s
LOCATION file line col _name
-> text "\t.loc" <+> ppr file <+> ppr line <+> ppr col
DELTA d
- -> pprInstr platform (COMMENT (mkFastString ("\tdelta = " ++ show d)))
+ -> asmComment $ text ("\tdelta = " ++ show d)
NEWBLOCK _
-> panic "PprMach.pprInstr: NEWBLOCK"