diff options
Diffstat (limited to 'compiler/main')
-rw-r--r-- | compiler/main/Constants.hs | 4 | ||||
-rw-r--r-- | compiler/main/StaticPtrTable.hs | 11 |
2 files changed, 10 insertions, 5 deletions
diff --git a/compiler/main/Constants.hs b/compiler/main/Constants.hs index cf3458507b..9935b03583 100644 --- a/compiler/main/Constants.hs +++ b/compiler/main/Constants.hs @@ -42,5 +42,9 @@ wORD64_SIZE = 8 fLOAT_SIZE :: Int fLOAT_SIZE = 4 +-- Size of double in bytes. +dOUBLE_SIZE :: Int +dOUBLE_SIZE = 8 + tARGET_MAX_CHAR :: Int tARGET_MAX_CHAR = 0x10ffff diff --git a/compiler/main/StaticPtrTable.hs b/compiler/main/StaticPtrTable.hs index ecc937665a..81a72230f3 100644 --- a/compiler/main/StaticPtrTable.hs +++ b/compiler/main/StaticPtrTable.hs @@ -178,6 +178,7 @@ sptCreateStaticBinds hsc_env this_mod binds go (reverse fps' ++ fps) (bnd' : bs) xs' dflags = hsc_dflags hsc_env + platform = targetPlatform dflags -- Generates keys and replaces 'makeStatic' with 'StaticPtr'. -- @@ -219,8 +220,8 @@ sptCreateStaticBinds hsc_env this_mod binds staticPtrDataCon <- lift $ lookupDataConHscEnv staticPtrDataConName return (fp, mkConApp staticPtrDataCon [ Type t - , mkWord64LitWordRep dflags w0 - , mkWord64LitWordRep dflags w1 + , mkWord64LitWordRep platform w0 + , mkWord64LitWordRep platform w1 , info , e ]) @@ -233,10 +234,10 @@ sptCreateStaticBinds hsc_env this_mod binds -- Choose either 'Word64#' or 'Word#' to represent the arguments of the -- 'Fingerprint' data constructor. - mkWord64LitWordRep dflags = - case platformWordSize (targetPlatform dflags) of + mkWord64LitWordRep platform = + case platformWordSize platform of PW4 -> mkWord64LitWord64 - PW8 -> mkWordLit dflags . toInteger + PW8 -> mkWordLit platform . toInteger lookupIdHscEnv :: Name -> IO Id lookupIdHscEnv n = lookupTypeHscEnv hsc_env n >>= |