summaryrefslogtreecommitdiff
path: root/compiler/GHC/CmmToAsm
diff options
context:
space:
mode:
authorSylvain Henry <sylvain@haskus.fr>2020-05-25 17:37:55 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-06-18 23:08:35 -0400
commitd4a0be758003f32b9d9d89cfd14b9839ac002f4d (patch)
tree2ced620f7598d9e71882be08b027a7ce9e448be2 /compiler/GHC/CmmToAsm
parent2af0ec9059b94e1fa6b37eda60216e0222e1a53d (diff)
downloadhaskell-d4a0be758003f32b9d9d89cfd14b9839ac002f4d.tar.gz
Move tablesNextToCode field into Platform
tablesNextToCode is a platform setting and doesn't belong into DynFlags (#17957). Doing this is also a prerequisite to fix #14335 where we deal with two platforms (target and host) that may have different platform settings.
Diffstat (limited to 'compiler/GHC/CmmToAsm')
-rw-r--r--compiler/GHC/CmmToAsm/X86/Ppr.hs10
1 files changed, 4 insertions, 6 deletions
diff --git a/compiler/GHC/CmmToAsm/X86/Ppr.hs b/compiler/GHC/CmmToAsm/X86/Ppr.hs
index 6be1c8ef4d..1accde5a5d 100644
--- a/compiler/GHC/CmmToAsm/X86/Ppr.hs
+++ b/compiler/GHC/CmmToAsm/X86/Ppr.hs
@@ -183,8 +183,8 @@ pprGloblDecl lbl
| not (externallyVisibleCLabel lbl) = empty
| otherwise = text ".globl " <> ppr lbl
-pprLabelType' :: DynFlags -> CLabel -> SDoc
-pprLabelType' dflags lbl =
+pprLabelType' :: Platform -> CLabel -> SDoc
+pprLabelType' platform lbl =
if isCFunctionLabel lbl || functionOkInfoTable then
text "@function"
else
@@ -237,16 +237,14 @@ pprLabelType' dflags lbl =
every code-like thing to give the needed information for to the tools
but mess up with the relocation. https://phabricator.haskell.org/D4730
-}
- functionOkInfoTable = tablesNextToCode dflags &&
+ functionOkInfoTable = platformTablesNextToCode platform &&
isInfoTableLabel lbl && not (isConInfoTableLabel lbl)
pprTypeDecl :: Platform -> CLabel -> SDoc
pprTypeDecl platform lbl
= if osElfTarget (platformOS platform) && externallyVisibleCLabel lbl
- then
- sdocWithDynFlags $ \df ->
- text ".type " <> ppr lbl <> ptext (sLit ", ") <> pprLabelType' df lbl
+ then text ".type " <> ppr lbl <> ptext (sLit ", ") <> pprLabelType' platform lbl
else empty
pprLabel :: Platform -> CLabel -> SDoc