summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Trommler <ptrommler@acm.org>2020-12-24 14:27:37 +0100
committerPeter Trommler <ptrommler@acm.org>2021-01-31 04:05:54 -0500
commitf1ce51da2262c6bf8c160c992c19ccf9ca8d3ea9 (patch)
treec765e8a198eea0815a6338c3bde3dc569d8296b4
parenteb90d23911ee10868dc2c7cc27a8397f0ae9b41d (diff)
downloadhaskell-wip/T19118.tar.gz
PPC NCG: print procedure end label for debugwip/T19118
Fixes #19118
-rw-r--r--compiler/GHC/CmmToAsm/PPC/Ppr.hs16
1 files changed, 11 insertions, 5 deletions
diff --git a/compiler/GHC/CmmToAsm/PPC/Ppr.hs b/compiler/GHC/CmmToAsm/PPC/Ppr.hs
index b4f9c98260..5f8ab214cb 100644
--- a/compiler/GHC/CmmToAsm/PPC/Ppr.hs
+++ b/compiler/GHC/CmmToAsm/PPC/Ppr.hs
@@ -66,8 +66,9 @@ pprNatCmmDecl config proc@(CmmProc top_info lbl _ (ListGraph blocks)) =
_ -> pprLabel platform lbl) $$ -- blocks guaranteed not null,
-- so label needed
vcat (map (pprBasicBlock config top_info) blocks) $$
- (if ncgDwarfEnabled config
- then pdoc platform (mkAsmTempEndLabel lbl) <> char ':' else empty) $$
+ ppWhen (ncgDwarfEnabled config) (pdoc platform (mkAsmTempEndLabel lbl)
+ <> char ':' $$
+ pprProcEndLabel platform lbl) $$
pprSizeDecl platform lbl
Just (CmmStaticsRaw info_lbl _) ->
@@ -127,15 +128,20 @@ pprFunctionPrologue platform lab = pprGloblDecl platform lab
$$ text "\t.localentry\t" <> pdoc platform lab
<> text ",.-" <> pdoc platform lab
+pprProcEndLabel :: Platform -> CLabel -- ^ Procedure name
+ -> SDoc
+pprProcEndLabel platform lbl =
+ pdoc platform (mkAsmTempProcEndLabel lbl) <> char ':'
+
pprBasicBlock :: NCGConfig -> LabelMap RawCmmStatics -> NatBasicBlock Instr
-> SDoc
pprBasicBlock config info_env (BasicBlock blockid instrs)
= maybe_infotable $$
pprLabel platform asmLbl $$
vcat (map (pprInstr platform) instrs) $$
- (if ncgDwarfEnabled config
- then pdoc platform (mkAsmTempEndLabel asmLbl) <> char ':'
- else empty
+ ppWhen (ncgDwarfEnabled config) (
+ pdoc platform (mkAsmTempEndLabel asmLbl) <> char ':'
+ <> pprProcEndLabel platform asmLbl
)
where
asmLbl = blockLbl blockid