summaryrefslogtreecommitdiff
path: root/compiler/GHC/CmmToAsm/X86
diff options
context:
space:
mode:
authorKrzysztof Gogolewski <krzysztof.gogolewski@tweag.io>2022-10-28 21:05:34 +0200
committerKrzysztof Gogolewski <krzysztof.gogolewski@tweag.io>2022-11-04 15:54:25 +0100
commit4dd9e74bb216244c77e973eca8047447dddd1509 (patch)
treee11a998f4ca8a25badfb289e2ff540347e78acea /compiler/GHC/CmmToAsm/X86
parent311251543f2e37af4a121e58028bfc46267a7fc9 (diff)
downloadhaskell-wip/strings-refactor3.tar.gz
Minor refactor around FastStringswip/strings-refactor3
Pass FastStrings to functions directly, to make sure the rule for fsLit "literal" fires. Remove SDoc indirection in GHCi.UI.Tags and GHC.Unit.Module.Graph.
Diffstat (limited to 'compiler/GHC/CmmToAsm/X86')
-rw-r--r--compiler/GHC/CmmToAsm/X86/Instr.hs5
-rw-r--r--compiler/GHC/CmmToAsm/X86/Ppr.hs2
-rw-r--r--compiler/GHC/CmmToAsm/X86/Regs.hs5
3 files changed, 7 insertions, 5 deletions
diff --git a/compiler/GHC/CmmToAsm/X86/Instr.hs b/compiler/GHC/CmmToAsm/X86/Instr.hs
index 42b9543204..06fc3f6c7e 100644
--- a/compiler/GHC/CmmToAsm/X86/Instr.hs
+++ b/compiler/GHC/CmmToAsm/X86/Instr.hs
@@ -38,6 +38,7 @@ module GHC.CmmToAsm.X86.Instr
where
import GHC.Prelude
+import GHC.Data.FastString
import GHC.CmmToAsm.X86.Cond
import GHC.CmmToAsm.X86.Regs
@@ -868,7 +869,7 @@ mkStackAllocInstr platform amount
case platformArch platform of
ArchX86 | needs_probe_call platform amount ->
[ MOV II32 (OpImm (ImmInt amount)) (OpReg eax)
- , CALL (Left $ strImmLit "___chkstk_ms") [eax]
+ , CALL (Left $ strImmLit (fsLit "___chkstk_ms")) [eax]
, SUB II32 (OpReg eax) (OpReg esp)
]
| otherwise ->
@@ -877,7 +878,7 @@ mkStackAllocInstr platform amount
]
ArchX86_64 | needs_probe_call platform amount ->
[ MOV II64 (OpImm (ImmInt amount)) (OpReg rax)
- , CALL (Left $ strImmLit "___chkstk_ms") [rax]
+ , CALL (Left $ strImmLit (fsLit "___chkstk_ms")) [rax]
, SUB II64 (OpReg rax) (OpReg rsp)
]
| otherwise ->
diff --git a/compiler/GHC/CmmToAsm/X86/Ppr.hs b/compiler/GHC/CmmToAsm/X86/Ppr.hs
index 6c16160ce8..32b163357d 100644
--- a/compiler/GHC/CmmToAsm/X86/Ppr.hs
+++ b/compiler/GHC/CmmToAsm/X86/Ppr.hs
@@ -432,7 +432,7 @@ pprImm platform = \case
ImmInteger i -> integer i
ImmCLbl l -> pprAsmLabel platform l
ImmIndex l i -> pprAsmLabel platform l <> char '+' <> int i
- ImmLit s -> text s
+ ImmLit s -> ftext s
ImmFloat f -> float $ fromRational f
ImmDouble d -> double $ fromRational d
ImmConstantSum a b -> pprImm platform a <> char '+' <> pprImm platform b
diff --git a/compiler/GHC/CmmToAsm/X86/Regs.hs b/compiler/GHC/CmmToAsm/X86/Regs.hs
index ab5558d8e1..25746f9deb 100644
--- a/compiler/GHC/CmmToAsm/X86/Regs.hs
+++ b/compiler/GHC/CmmToAsm/X86/Regs.hs
@@ -48,6 +48,7 @@ module GHC.CmmToAsm.X86.Regs (
where
import GHC.Prelude
+import GHC.Data.FastString
import GHC.Platform.Regs
import GHC.Platform.Reg
@@ -110,14 +111,14 @@ data Imm
= ImmInt Int
| ImmInteger Integer -- Sigh.
| ImmCLbl CLabel -- AbstractC Label (with baggage)
- | ImmLit String
+ | ImmLit FastString
| ImmIndex CLabel Int
| ImmFloat Rational
| ImmDouble Rational
| ImmConstantSum Imm Imm
| ImmConstantDiff Imm Imm
-strImmLit :: String -> Imm
+strImmLit :: FastString -> Imm
strImmLit s = ImmLit s