summaryrefslogtreecommitdiff
path: root/compiler/GHC/Platform.hs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/GHC/Platform.hs')
-rw-r--r--compiler/GHC/Platform.hs9
1 files changed, 8 insertions, 1 deletions
diff --git a/compiler/GHC/Platform.hs b/compiler/GHC/Platform.hs
index 5e54e2111e..5ce843046b 100644
--- a/compiler/GHC/Platform.hs
+++ b/compiler/GHC/Platform.hs
@@ -3,6 +3,7 @@
-- | Platform description
module GHC.Platform
( Platform (..)
+ , platformConstants
, PlatformWordSize(..)
, PlatformConstants(..)
, platformArch
@@ -45,6 +46,7 @@ import GHC.Read
import GHC.ByteOrder (ByteOrder(..))
import GHC.Platform.Constants
import GHC.Platform.ArchOS
+import GHC.Utils.Panic.Plain
import Data.Word
import Data.Int
@@ -67,11 +69,16 @@ data Platform = Platform
-- ^ Determines whether we will be compiling info tables that reside just
-- before the entry code, or with an indirection to the entry code. See
-- TABLES_NEXT_TO_CODE in includes/rts/storage/InfoTables.h.
- , platformConstants :: !PlatformConstants
+ , platform_constants :: !(Maybe PlatformConstants)
-- ^ Constants such as structure offsets, type sizes, etc.
}
deriving (Read, Show, Eq)
+platformConstants :: Platform -> PlatformConstants
+platformConstants platform = case platform_constants platform of
+ Nothing -> panic "Platform constants not available!"
+ Just c -> c
+
data PlatformWordSize
= PW4 -- ^ A 32-bit platform
| PW8 -- ^ A 64-bit platform