summaryrefslogtreecommitdiff
path: root/compiler/cmm/CLabel.hs
diff options
context:
space:
mode:
authorThijs Alkemade <me@thijsalkema.de>2016-12-06 17:12:17 -0500
committerBen Gamari <ben@smart-cactus.org>2016-12-06 18:44:43 -0500
commitb7e88ee0d87f41cf1d8aba62aa44d5bf0a7404ad (patch)
treea80d546ceee8179f8eca6f26840da6edb74ca51e /compiler/cmm/CLabel.hs
parenteafa06dce4aa815159ebba5a34d5137cf401ffbc (diff)
downloadhaskell-b7e88ee0d87f41cf1d8aba62aa44d5bf0a7404ad.tar.gz
Reduce the size of string literals in binaries.
Removed the alignment for strings and mark then as cstring sections in the generated asm so the linker can merge duplicate sections. Reviewers: rwbarton, trofi, austin, trommler, simonmar, hvr, bgamari Reviewed By: hvr, bgamari Subscribers: simonpj, hvr, thomie Differential Revision: https://phabricator.haskell.org/D1290 GHC Trac Issues: #9577
Diffstat (limited to 'compiler/cmm/CLabel.hs')
-rw-r--r--compiler/cmm/CLabel.hs8
1 files changed, 6 insertions, 2 deletions
diff --git a/compiler/cmm/CLabel.hs b/compiler/cmm/CLabel.hs
index 960220f2c2..7317ea4188 100644
--- a/compiler/cmm/CLabel.hs
+++ b/compiler/cmm/CLabel.hs
@@ -1088,6 +1088,10 @@ pprCLabel platform (DeadStripPreventer lbl)
| cGhcWithNativeCodeGen == "YES"
= pprCLabel platform lbl <> text "_dsp"
+pprCLabel _ (StringLitLabel u)
+ | cGhcWithNativeCodeGen == "YES"
+ = pprUnique u <> ptext (sLit "_str")
+
pprCLabel platform lbl
= getPprStyle $ \ sty ->
if cGhcWithNativeCodeGen == "YES" && asmStyle sty
@@ -1109,8 +1113,8 @@ pprAsmCLbl _ lbl
= pprCLbl lbl
pprCLbl :: CLabel -> SDoc
-pprCLbl (StringLitLabel u)
- = pprUnique u <> text "_str"
+pprCLbl (StringLitLabel _)
+ = panic "pprCLbl StringLitLabel"
pprCLbl (CaseLabel u CaseReturnPt)
= hcat [pprUnique u, text "_ret"]