summaryrefslogtreecommitdiff
path: root/compiler/GHC/CmmToAsm/Config.hs
diff options
context:
space:
mode:
authorSylvain Henry <sylvain@haskus.fr>2020-07-07 18:48:31 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-07-25 00:45:08 -0400
commit9dfeca6c2019fdb46613a68ccd6e650e40c7baac (patch)
tree29a2cda3faddedc7024be259011f4406b6473f45 /compiler/GHC/CmmToAsm/Config.hs
parent6333d7391068d8029eed3e8eff019b9e2c104c7b (diff)
downloadhaskell-9dfeca6c2019fdb46613a68ccd6e650e40c7baac.tar.gz
Remove platform constant wrappers
Platform constant wrappers took a DynFlags parameter, hence implicitly used the target platform constants. We removed them to allow support for several platforms at once (#14335) and to avoid having to pass the full DynFlags to every function (#17957). Metric Decrease: T4801
Diffstat (limited to 'compiler/GHC/CmmToAsm/Config.hs')
-rw-r--r--compiler/GHC/CmmToAsm/Config.hs6
1 files changed, 5 insertions, 1 deletions
diff --git a/compiler/GHC/CmmToAsm/Config.hs b/compiler/GHC/CmmToAsm/Config.hs
index 6be6f17342..e6b5489b9e 100644
--- a/compiler/GHC/CmmToAsm/Config.hs
+++ b/compiler/GHC/CmmToAsm/Config.hs
@@ -2,6 +2,7 @@
module GHC.CmmToAsm.Config
( NCGConfig(..)
, ncgWordWidth
+ , ncgSpillPreallocSize
, platformWordWidth
)
where
@@ -20,7 +21,6 @@ data NCGConfig = NCGConfig
, ncgInlineThresholdMemcpy :: !Word -- ^ If inlining `memcpy` produces less than this threshold (in pseudo-instruction unit), do it
, ncgInlineThresholdMemset :: !Word -- ^ Ditto for `memset`
, ncgSplitSections :: !Bool -- ^ Split sections
- , ncgSpillPreallocSize :: !Int -- ^ Size in bytes of the pre-allocated spill space on the C stack
, ncgRegsIterative :: !Bool
, ncgAsmLinting :: !Bool -- ^ Perform ASM linting pass
, ncgDoConstantFolding :: !Bool -- ^ Perform CMM constant folding
@@ -35,6 +35,10 @@ data NCGConfig = NCGConfig
ncgWordWidth :: NCGConfig -> Width
ncgWordWidth config = platformWordWidth (ncgPlatform config)
+-- | Size in bytes of the pre-allocated spill space on the C stack
+ncgSpillPreallocSize :: NCGConfig -> Int
+ncgSpillPreallocSize config = pc_RESERVED_C_STACK_BYTES (platformConstants (ncgPlatform config))
+
-- | Return Word size
platformWordWidth :: Platform -> Width
platformWordWidth platform = case platformWordSize platform of