summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Trommler <ptrommler@acm.org>2020-12-24 14:27:37 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-02-17 11:21:47 -0500
commit53677c96e385e9867377378d00dcb7623b0c3f13 (patch)
tree9412836312d8141e5144e59611b782f7c8a9d7c9
parentbf95dd2ccaea32fa65dd74bc51025077b935c154 (diff)
downloadhaskell-53677c96e385e9867377378d00dcb7623b0c3f13.tar.gz
PPC NCG: print procedure end label for debug
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