Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
0c0a15a8
Commit
0c0a15a8
authored
Sep 19, 2019
by
Ben Gamari
🐢
Committed by
Marge Bot
Oct 09, 2019
Browse files
Rename STAGE macro to GHC_STAGE
To avoid polluting the macro namespace
parent
f691f0c2
Changes
7
Hide whitespace changes
Inline
Side-by-side
compiler/ghc.mk
View file @
0c0a15a8
...
...
@@ -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
=
-D
GHC_
STAGE
=
1
compiler_stage2_CONFIGURE_OPTS
+=
--ghc-option
=
-D
GHC_
STAGE
=
2
compiler_stage3_CONFIGURE_OPTS
+=
--ghc-option
=
-D
GHC_
STAGE
=
3
compiler_stage2_HADDOCK_OPTS
+=
--optghc
=
-D
GHC_
STAGE
=
2
compiler/stage1/package-data.mk
:
compiler/ghc.mk
compiler/stage2/package-data.mk
:
compiler/ghc.mk
...
...
compiler/main/DynFlags.hs
View file @
0c0a15a8
...
...
@@ -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
...
...
compiler/utils/FastString.hs
View file @
0c0a15a8
...
...
@@ -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
)
...
...
hadrian/src/Rules/Generate.hs
View file @
0c0a15a8
...
...
@@ -369,7 +369,7 @@ generateConfigHs = do
,
"cBooterVersion = "
++
show
cBooterVersion
,
""
,
"cStage :: String"
,
"cStage = show (STAGE :: Int)"
,
"cStage = show (
GHC_
STAGE :: Int)"
]
-- | Generate @ghcautoconf.h@ header.
...
...
hadrian/src/Settings/Packages.hs
View file @
0c0a15a8
...
...
@@ -58,7 +58,7 @@ packageArgs = do
pure
[
"-O0"
]
]
,
builder
(
Cabal
Setup
)
?
mconcat
[
arg
$
"--ghc-option=-DSTAGE="
++
show
(
fromEnum
stage
+
1
)
[
arg
$
"--ghc-option=-D
GHC_
STAGE="
++
show
(
fromEnum
stage
+
1
)
,
arg
"--disable-library-for-ghci"
,
anyTargetOs
[
"openbsd"
]
?
arg
"--ld-options=-E"
,
flag
GhcUnregisterised
?
arg
"--ghc-option=-DNO_REGS"
...
...
includes/MachDeps.h
View file @
0c0a15a8
...
...
@@ -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
-D
STAGE=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 */
utils/ghc-in-ghci/settings.ghci
View file @
0c0a15a8
...
...
@@ -29,7 +29,7 @@
:set -Iincludes
:set -Iincludes/dist-derivedconstants/header
:set -package=ghc-boot-th
:set -DSTAGE=2
:set -D
GHC_
STAGE=2
:set -DHAVE_INTERNAL_INTERPRETER
:set -DGHC_LOADED_INTO_GHCI
:set -XNoImplicitPrelude
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment