summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2019-09-19 10:31:06 -0400
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-10-09 16:21:14 -0400
commit0c0a15a8541a9119536ee17849d8390cb21ab764 (patch)
tree5ad55179918684d38c4fcff8a502d3d8c5b460e1
parentf691f0c21dcc576e02313123e8b091e241d23b51 (diff)
downloadhaskell-0c0a15a8541a9119536ee17849d8390cb21ab764.tar.gz
Rename STAGE macro to GHC_STAGE
To avoid polluting the macro namespace
-rw-r--r--compiler/ghc.mk10
-rw-r--r--compiler/main/DynFlags.hs4
-rw-r--r--compiler/utils/FastString.hs6
-rw-r--r--hadrian/src/Rules/Generate.hs2
-rw-r--r--hadrian/src/Settings/Packages.hs2
-rw-r--r--includes/MachDeps.h8
-rw-r--r--utils/ghc-in-ghci/settings.ghci2
7 files changed, 17 insertions, 17 deletions
diff --git a/compiler/ghc.mk b/compiler/ghc.mk
index 7c301552cf..8703e247c8 100644
--- a/compiler/ghc.mk
+++ b/compiler/ghc.mk
@@ -93,7 +93,7 @@ compiler/stage$1/build/Config.hs : mk/config.mk mk/project.mk | $$$$(dir $$$$@)/
@echo 'cBooterVersion = "$(GhcVersion)"' >> $$@
@echo >> $$@
@echo 'cStage :: String' >> $$@
- @echo 'cStage = show (STAGE :: Int)' >> $$@
+ @echo 'cStage = show (GHC_STAGE :: Int)' >> $$@
@echo done.
endef
@@ -270,10 +270,10 @@ endif
compiler_stage3_CONFIGURE_OPTS := $(compiler_stage2_CONFIGURE_OPTS)
-compiler_stage1_CONFIGURE_OPTS += --ghc-option=-DSTAGE=1
-compiler_stage2_CONFIGURE_OPTS += --ghc-option=-DSTAGE=2
-compiler_stage3_CONFIGURE_OPTS += --ghc-option=-DSTAGE=3
-compiler_stage2_HADDOCK_OPTS += --optghc=-DSTAGE=2
+compiler_stage1_CONFIGURE_OPTS += --ghc-option=-DGHC_STAGE=1
+compiler_stage2_CONFIGURE_OPTS += --ghc-option=-DGHC_STAGE=2
+compiler_stage3_CONFIGURE_OPTS += --ghc-option=-DGHC_STAGE=3
+compiler_stage2_HADDOCK_OPTS += --optghc=-DGHC_STAGE=2
compiler/stage1/package-data.mk : compiler/ghc.mk
compiler/stage2/package-data.mk : compiler/ghc.mk
diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs
index 6176e2b155..0079ec3d80 100644
--- a/compiler/main/DynFlags.hs
+++ b/compiler/main/DynFlags.hs
@@ -320,7 +320,7 @@ import qualified EnumSet
import GHC.Foreign (withCString, peekCString)
import qualified GHC.LanguageExtensions as LangExt
-#if STAGE >= 2
+#if GHC_STAGE >= 2
-- used by SHARED_GLOBAL_VAR
import Foreign (Ptr)
#endif
@@ -5741,7 +5741,7 @@ defaultGlobalDynFlags =
settings = panic "v_unsafeGlobalDynFlags: settings not initialised"
llvmConfig = panic "v_unsafeGlobalDynFlags: llvmConfig not initialised"
-#if STAGE < 2
+#if GHC_STAGE < 2
GLOBAL_VAR(v_unsafeGlobalDynFlags, defaultGlobalDynFlags, DynFlags)
#else
SHARED_GLOBAL_VAR( v_unsafeGlobalDynFlags
diff --git a/compiler/utils/FastString.hs b/compiler/utils/FastString.hs
index 8f3d454a1f..62a81aa10d 100644
--- a/compiler/utils/FastString.hs
+++ b/compiler/utils/FastString.hs
@@ -124,7 +124,7 @@ import GHC.IO
import Foreign
-#if STAGE >= 2
+#if GHC_STAGE >= 2
import GHC.Conc.Sync (sharedCAF)
#endif
@@ -333,12 +333,12 @@ stringTable = unsafePerformIO $ do
-- use the support wired into the RTS to share this CAF among all images of
-- libHSghc
-#if STAGE < 2
+#if GHC_STAGE < 2
return tab
#else
sharedCAF tab getOrSetLibHSghcFastStringTable
--- from the RTS; thus we cannot use this mechanism when STAGE<2; the previous
+-- from the RTS; thus we cannot use this mechanism when GHC_STAGE<2; the previous
-- RTS might not have this symbol
foreign import ccall unsafe "getOrSetLibHSghcFastStringTable"
getOrSetLibHSghcFastStringTable :: Ptr a -> IO (Ptr a)
diff --git a/hadrian/src/Rules/Generate.hs b/hadrian/src/Rules/Generate.hs
index 4afdc0cdae..3e4815216a 100644
--- a/hadrian/src/Rules/Generate.hs
+++ b/hadrian/src/Rules/Generate.hs
@@ -369,7 +369,7 @@ generateConfigHs = do
, "cBooterVersion = " ++ show cBooterVersion
, ""
, "cStage :: String"
- , "cStage = show (STAGE :: Int)"
+ , "cStage = show (GHC_STAGE :: Int)"
]
-- | Generate @ghcautoconf.h@ header.
diff --git a/hadrian/src/Settings/Packages.hs b/hadrian/src/Settings/Packages.hs
index 20bd114480..6c6b00064c 100644
--- a/hadrian/src/Settings/Packages.hs
+++ b/hadrian/src/Settings/Packages.hs
@@ -58,7 +58,7 @@ packageArgs = do
pure ["-O0"] ]
, builder (Cabal Setup) ? mconcat
- [ arg $ "--ghc-option=-DSTAGE=" ++ show (fromEnum stage + 1)
+ [ arg $ "--ghc-option=-DGHC_STAGE=" ++ show (fromEnum stage + 1)
, arg "--disable-library-for-ghci"
, anyTargetOs ["openbsd"] ? arg "--ld-options=-E"
, flag GhcUnregisterised ? arg "--ghc-option=-DNO_REGS"
diff --git a/includes/MachDeps.h b/includes/MachDeps.h
index fd13e3315a..5160e381e0 100644
--- a/includes/MachDeps.h
+++ b/includes/MachDeps.h
@@ -25,7 +25,7 @@
* In those cases code change assumed target defines like SIZEOF_HSINT
* are applied to host platform, not target platform.
*
- * So what should be used instead in STAGE=1?
+ * So what should be used instead in GHC_STAGE=1?
*
* To get host's equivalent of SIZEOF_HSINT you can use Bits instances:
* Data.Bits.finiteBitSize (0 :: Int)
@@ -36,9 +36,9 @@
* wORD_SIZE :: DynFlags -> Int
* wORD_SIZE dflags = pc_WORD_SIZE (platformConstants dflags)
*
- * Hence we hide these macros from -DSTAGE=1
+ * Hence we hide these macros from GHC_STAGE=1
*/
-#if !defined(STAGE) || STAGE >= 2
+#if !defined(GHC_STAGE) || GHC_STAGE >= 2
/* Sizes of C types come from here... */
#include "ghcautoconf.h"
@@ -120,4 +120,4 @@
#define TAG_MASK ((1 << TAG_BITS) - 1)
-#endif /* !defined(STAGE) || STAGE >= 2 */
+#endif /* !defined(GHC_STAGE) || GHC_STAGE >= 2 */
diff --git a/utils/ghc-in-ghci/settings.ghci b/utils/ghc-in-ghci/settings.ghci
index dde12f3f26..eed64a9107 100644
--- a/utils/ghc-in-ghci/settings.ghci
+++ b/utils/ghc-in-ghci/settings.ghci
@@ -29,7 +29,7 @@
:set -Iincludes
:set -Iincludes/dist-derivedconstants/header
:set -package=ghc-boot-th
-:set -DSTAGE=2
+:set -DGHC_STAGE=2
:set -DHAVE_INTERNAL_INTERPRETER
:set -DGHC_LOADED_INTO_GHCI
:set -XNoImplicitPrelude