projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Output ELF .size directives for functions
[ghc-hetmet.git]
/
compiler
/
nativeGen
/
X86
/
Ppr.hs
diff --git
a/compiler/nativeGen/X86/Ppr.hs
b/compiler/nativeGen/X86/Ppr.hs
index
0f0f9d2
..
4c3454d
100644
(file)
--- a/
compiler/nativeGen/X86/Ppr.hs
+++ b/
compiler/nativeGen/X86/Ppr.hs
@@
-87,7
+87,17
@@
pprNatCmmTop (CmmProc info lbl (ListGraph blocks)) =
<+> pprCLabel_asm (mkDeadStripPreventer $ entryLblToInfoLbl lbl)
else empty
#endif
<+> pprCLabel_asm (mkDeadStripPreventer $ entryLblToInfoLbl lbl)
else empty
#endif
+ $$ 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
+#else
+pprSizeDecl _ = empty
+#endif
pprBasicBlock :: NatBasicBlock Instr -> Doc
pprBasicBlock (BasicBlock blockid instrs) =
pprBasicBlock :: NatBasicBlock Instr -> Doc
pprBasicBlock (BasicBlock blockid instrs) =