Commit 0c0a15a8 authored by Ben Gamari's avatar Ben Gamari 🐢 Committed by Marge Bot

Rename STAGE macro to GHC_STAGE

To avoid polluting the macro namespace
parent f691f0c2
......@@ -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
......
......@@ -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
......
......@@ -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)
......
......@@ -369,7 +369,7 @@ generateConfigHs = do
, "cBooterVersion = " ++ show cBooterVersion
, ""
, "cStage :: String"
, "cStage = show (STAGE :: Int)"
, "cStage = show (GHC_STAGE :: Int)"
]
-- | Generate @ghcautoconf.h@ header.
......
......@@ -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"
......
......@@ -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 */
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment