summaryrefslogtreecommitdiff
path: root/compiler/codeGen/StgCmmCon.hs
diff options
context:
space:
mode:
authorIan Lynagh <ian@well-typed.com>2012-09-14 13:57:48 +0100
committerIan Lynagh <ian@well-typed.com>2012-09-14 13:57:48 +0100
commit041e832cf0ef490dd0d4fd24d56a2f7f1adb5c9c (patch)
treed22a1cbf361f5cdf60cd35205638e2419c0db6f3 /compiler/codeGen/StgCmmCon.hs
parent291da8a0624d3844d30931d0e89f51e3daf03a61 (diff)
downloadhaskell-041e832cf0ef490dd0d4fd24d56a2f7f1adb5c9c.tar.gz
Move some more constants fo platformConstants
Diffstat (limited to 'compiler/codeGen/StgCmmCon.hs')
-rw-r--r--compiler/codeGen/StgCmmCon.hs13
1 files changed, 6 insertions, 7 deletions
diff --git a/compiler/codeGen/StgCmmCon.hs b/compiler/codeGen/StgCmmCon.hs
index 15686a8c9a..0e0f2f13f8 100644
--- a/compiler/codeGen/StgCmmCon.hs
+++ b/compiler/codeGen/StgCmmCon.hs
@@ -31,7 +31,6 @@ import MkGraph
import SMRep
import CostCentre
import Module
-import Constants
import DataCon
import DynFlags
import FastString
@@ -184,11 +183,11 @@ buildDynCon' dflags platform binder _cc con [arg]
| maybeIntLikeCon con
, platformOS platform /= OSMinGW32 || not (dopt Opt_PIC dflags)
, StgLitArg (MachInt val) <- arg
- , val <= fromIntegral mAX_INTLIKE -- Comparisons at type Integer!
- , val >= fromIntegral mIN_INTLIKE -- ...ditto...
+ , val <= fromIntegral (mAX_INTLIKE dflags) -- Comparisons at type Integer!
+ , val >= fromIntegral (mIN_INTLIKE dflags) -- ...ditto...
= do { let intlike_lbl = mkCmmGcPtrLabel rtsPackageId (fsLit "stg_INTLIKE_closure")
val_int = fromIntegral val :: Int
- offsetW = (val_int - mIN_INTLIKE) * (fixedHdrSize dflags + 1)
+ offsetW = (val_int - mIN_INTLIKE dflags) * (fixedHdrSize dflags + 1)
-- INTLIKE closures consist of a header and one word payload
intlike_amode = cmmLabelOffW intlike_lbl offsetW
; return ( litIdInfo dflags binder (mkConLFInfo con) intlike_amode
@@ -199,10 +198,10 @@ buildDynCon' dflags platform binder _cc con [arg]
, platformOS platform /= OSMinGW32 || not (dopt Opt_PIC dflags)
, StgLitArg (MachChar val) <- arg
, let val_int = ord val :: Int
- , val_int <= mAX_CHARLIKE
- , val_int >= mIN_CHARLIKE
+ , val_int <= mAX_CHARLIKE dflags
+ , val_int >= mIN_CHARLIKE dflags
= do { let charlike_lbl = mkCmmGcPtrLabel rtsPackageId (fsLit "stg_CHARLIKE_closure")
- offsetW = (val_int - mIN_CHARLIKE) * (fixedHdrSize dflags + 1)
+ offsetW = (val_int - mIN_CHARLIKE dflags) * (fixedHdrSize dflags + 1)
-- CHARLIKE closures consist of a header and one word payload
charlike_amode = cmmLabelOffW charlike_lbl offsetW
; return ( litIdInfo dflags binder (mkConLFInfo con) charlike_amode