Commit 32f24ddf authored by tibbe's avatar tibbe Committed by Ian Lynagh
Browse files

Output ELF .size directives for functions

This allows tools like Linux's perf events to display symbol names for
CMM primops.
parent 7aa15ca8
......@@ -87,7 +87,17 @@ pprNatCmmTop (CmmProc info lbl (ListGraph blocks)) =
<+> pprCLabel_asm (mkDeadStripPreventer $ entryLblToInfoLbl lbl)
else empty
$$ pprSizeDecl (if null info then lbl else entryLblToInfoLbl lbl)
-- | Output the ELF .size directive.
pprSizeDecl :: CLabel -> Doc
#if elf_OBJ_FORMAT
pprSizeDecl lbl =
ptext (sLit "\t.size") <+> pprCLabel_asm lbl
<> ptext (sLit ", .-") <> pprCLabel_asm lbl
pprSizeDecl _ = empty
pprBasicBlock :: NatBasicBlock Instr -> Doc
pprBasicBlock (BasicBlock blockid instrs) =
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment