diff options
author | Sylvain Henry <sylvain@haskus.fr> | 2020-03-18 16:37:25 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-05-06 04:43:21 -0400 |
commit | cab1871ab93feeacf2bf9a1c65b1c919ca9c5399 (patch) | |
tree | 1c8c7a535ca81d9f8ef26532425ff746b305cc13 /libraries | |
parent | a95e7fe02efd2fdeec91ba46de64bc78c81381eb (diff) | |
download | haskell-cab1871ab93feeacf2bf9a1c65b1c919ca9c5399.tar.gz |
Move LeadingUnderscore into Platform (#17957)
Avoid direct use of DynFlags to know if symbols must be prefixed by an
underscore.
Diffstat (limited to 'libraries')
-rw-r--r-- | libraries/ghc-boot/GHC/Platform.hs | 20 | ||||
-rw-r--r-- | libraries/ghc-boot/GHC/Settings/Platform.hs | 2 |
2 files changed, 12 insertions, 10 deletions
diff --git a/libraries/ghc-boot/GHC/Platform.hs b/libraries/ghc-boot/GHC/Platform.hs index 7af9cc0890..69978387ae 100644 --- a/libraries/ghc-boot/GHC/Platform.hs +++ b/libraries/ghc-boot/GHC/Platform.hs @@ -55,16 +55,17 @@ data PlatformMini deriving (Read, Show, Eq) -- | Contains enough information for the native code generator to emit --- code for this platform. +-- code for this platform. data Platform = Platform - { platformMini :: PlatformMini - , platformWordSize :: PlatformWordSize - , platformByteOrder :: ByteOrder - , platformUnregisterised :: Bool - , platformHasGnuNonexecStack :: Bool - , platformHasIdentDirective :: Bool - , platformHasSubsectionsViaSymbols :: Bool - , platformIsCrossCompiling :: Bool + { platformMini :: !PlatformMini + , platformWordSize :: !PlatformWordSize -- ^ Word size + , platformByteOrder :: !ByteOrder -- ^ Byte order (endianness) + , platformUnregisterised :: !Bool + , platformHasGnuNonexecStack :: !Bool + , platformHasIdentDirective :: !Bool + , platformHasSubsectionsViaSymbols :: !Bool + , platformIsCrossCompiling :: !Bool + , platformLeadingUnderscore :: !Bool -- ^ Symbols need underscore prefix } deriving (Read, Show, Eq) @@ -301,7 +302,6 @@ data PlatformMisc = PlatformMisc -- before the entry code, or with an indirection to the entry code. See -- TABLES_NEXT_TO_CODE in includes/rts/storage/InfoTables.h. , platformMisc_tablesNextToCode :: Bool - , platformMisc_leadingUnderscore :: Bool , platformMisc_libFFI :: Bool , platformMisc_ghcThreaded :: Bool , platformMisc_ghcDebugged :: Bool diff --git a/libraries/ghc-boot/GHC/Settings/Platform.hs b/libraries/ghc-boot/GHC/Settings/Platform.hs index f97fff6b6f..0f41974002 100644 --- a/libraries/ghc-boot/GHC/Settings/Platform.hs +++ b/libraries/ghc-boot/GHC/Settings/Platform.hs @@ -37,6 +37,7 @@ getTargetPlatform settingsFile mySettings = do targetOS <- readSetting "target os" targetWordSize <- readSetting "target word size" targetWordBigEndian <- getBooleanSetting "target word big endian" + targetLeadingUnderscore <- getBooleanSetting "Leading underscore" targetUnregisterised <- getBooleanSetting "Unregisterised" targetHasGnuNonexecStack <- getBooleanSetting "target has GNU nonexec stack" targetHasIdentDirective <- getBooleanSetting "target has .ident directive" @@ -55,6 +56,7 @@ getTargetPlatform settingsFile mySettings = do , platformHasIdentDirective = targetHasIdentDirective , platformHasSubsectionsViaSymbols = targetHasSubsectionsViaSymbols , platformIsCrossCompiling = crossCompiling + , platformLeadingUnderscore = targetLeadingUnderscore } ----------------------------------------------------------------------------- |