summaryrefslogtreecommitdiff
path: root/compiler/GHC/Data
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2021-10-27 04:06:46 +0000
committerJohn Ericson <John.Ericson@Obsidian.Systems>2021-10-27 20:55:50 +0000
commit5a6f3c285b986891b8b56f8f1b29901892ca4e15 (patch)
tree55addb41e4608890c406b93456c4b02465cf060d /compiler/GHC/Data
parent638f65482ca5265c268aa97abfcc14cdc27e46ba (diff)
downloadhaskell-wip/clean-compiler-includes.tar.gz
Avoid GHC_STAGE and other include bitswip/clean-compiler-includes
We should strive to make our includes in terms of the RTS as much as possible. One place there that is not possible, the llvm version, we make a new tiny header Stage numbers are somewhat arbitrary, if we simple need a newer RTS, we should say so.
Diffstat (limited to 'compiler/GHC/Data')
-rw-r--r--compiler/GHC/Data/FastString.hs12
1 files changed, 5 insertions, 7 deletions
diff --git a/compiler/GHC/Data/FastString.hs b/compiler/GHC/Data/FastString.hs
index 262ddd3ada..1b2f21c415 100644
--- a/compiler/GHC/Data/FastString.hs
+++ b/compiler/GHC/Data/FastString.hs
@@ -111,9 +111,6 @@ module GHC.Data.FastString
lengthPS
) where
--- For GHC_STAGE
-#include "ghcplatform.h"
-
import GHC.Prelude as Prelude
import GHC.Utils.Encoding
@@ -143,7 +140,7 @@ import Data.Semigroup as Semi
import Foreign
-#if GHC_STAGE >= 2
+#if MIN_VERSION_GLASGOW_HASKELL(9,3,0,0)
import GHC.Conc.Sync (sharedCAF)
#endif
@@ -384,13 +381,14 @@ stringTable = unsafePerformIO $ do
-- use the support wired into the RTS to share this CAF among all images of
-- libHSghc
-#if GHC_STAGE < 2
+#if !MIN_VERSION_GLASGOW_HASKELL(9,3,0,0)
return tab
#else
sharedCAF tab getOrSetLibHSghcFastStringTable
--- from the RTS; thus we cannot use this mechanism when GHC_STAGE<2; the previous
--- RTS might not have this symbol
+-- from the 9.3 RTS; the previouss RTS before might not have this symbol. The
+-- right way to do this however would be to define some HAVE_FAST_STRING_TABLE
+-- or similar rather than use (odd parity) development versions.
foreign import ccall unsafe "getOrSetLibHSghcFastStringTable"
getOrSetLibHSghcFastStringTable :: Ptr a -> IO (Ptr a)
#endif