summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lynagh <ian@well-typed.com>2012-09-13 19:12:30 +0100
committerIan Lynagh <ian@well-typed.com>2012-09-13 19:12:30 +0100
commit4279ab5050df28ba7abd79296a788d1ddb9eb5df (patch)
treea8272030704b755e28f99496582fba0b797a048e
parent07c3777105e9e7292b472af9277cf8710492e038 (diff)
downloadhaskell-4279ab5050df28ba7abd79296a788d1ddb9eb5df.tar.gz
Use sIZEOF_* from platformConstants rather than Constants
-rw-r--r--compiler/cmm/SMRep.lhs6
-rw-r--r--compiler/codeGen/CgInfoTbls.hs2
-rw-r--r--compiler/codeGen/CgPrimOp.hs2
-rw-r--r--compiler/codeGen/CgStackery.lhs2
-rw-r--r--compiler/codeGen/StgCmmBind.hs2
-rw-r--r--compiler/codeGen/StgCmmLayout.hs2
-rw-r--r--compiler/codeGen/StgCmmPrim.hs2
-rw-r--r--includes/mkDerivedConstants.c8
8 files changed, 12 insertions, 14 deletions
diff --git a/compiler/cmm/SMRep.lhs b/compiler/cmm/SMRep.lhs
index 1d5574ae8f..68effd7cb3 100644
--- a/compiler/cmm/SMRep.lhs
+++ b/compiler/cmm/SMRep.lhs
@@ -235,17 +235,17 @@ minClosureSize dflags = fixedHdrSize dflags + mIN_PAYLOAD_SIZE
arrWordsHdrSize :: DynFlags -> ByteOff
arrWordsHdrSize dflags
- = fixedHdrSize dflags * wORD_SIZE + sIZEOF_StgArrWords_NoHdr
+ = fixedHdrSize dflags * wORD_SIZE + sIZEOF_StgArrWords_NoHdr dflags
arrPtrsHdrSize :: DynFlags -> ByteOff
arrPtrsHdrSize dflags
- = fixedHdrSize dflags * wORD_SIZE + sIZEOF_StgMutArrPtrs_NoHdr
+ = fixedHdrSize dflags * wORD_SIZE + sIZEOF_StgMutArrPtrs_NoHdr dflags
-- Thunks have an extra header word on SMP, so the update doesn't
-- splat the payload.
thunkHdrSize :: DynFlags -> WordOff
thunkHdrSize dflags = fixedHdrSize dflags + smp_hdr
- where smp_hdr = sIZEOF_StgSMPThunkHeader `quot` wORD_SIZE
+ where smp_hdr = sIZEOF_StgSMPThunkHeader dflags `quot` wORD_SIZE
nonHdrSize :: SMRep -> WordOff
diff --git a/compiler/codeGen/CgInfoTbls.hs b/compiler/codeGen/CgInfoTbls.hs
index 18e3532db9..ce4228e0fc 100644
--- a/compiler/codeGen/CgInfoTbls.hs
+++ b/compiler/codeGen/CgInfoTbls.hs
@@ -347,7 +347,7 @@ funInfoTable :: DynFlags -> CmmExpr -> CmmExpr
-- in the info table.
funInfoTable dflags info_ptr
| tablesNextToCode dflags
- = cmmOffsetB dflags info_ptr (- stdInfoTableSizeB dflags - sIZEOF_StgFunInfoExtraRev)
+ = cmmOffsetB dflags info_ptr (- stdInfoTableSizeB dflags - sIZEOF_StgFunInfoExtraRev dflags)
| otherwise
= cmmOffsetW dflags info_ptr (1 + stdInfoTableSizeW dflags)
-- Past the entry code pointer
diff --git a/compiler/codeGen/CgPrimOp.hs b/compiler/codeGen/CgPrimOp.hs
index 1accdbe213..1d2359a1ed 100644
--- a/compiler/codeGen/CgPrimOp.hs
+++ b/compiler/codeGen/CgPrimOp.hs
@@ -1025,7 +1025,7 @@ emitCloneArray :: CLabel -> CmmFormal -> CmmExpr -> CmmExpr -> CmmExpr
emitCloneArray info_p res_r src0 src_off0 n0 live = do
dflags <- getDynFlags
let arrPtrsHdrSizeW dflags = CmmLit $ mkIntCLit dflags $ fixedHdrSize dflags +
- (sIZEOF_StgMutArrPtrs_NoHdr `div` wORD_SIZE)
+ (sIZEOF_StgMutArrPtrs_NoHdr dflags `div` wORD_SIZE)
myCapability = cmmSubWord dflags (CmmReg baseReg)
(CmmLit (mkIntCLit dflags oFFSET_Capability_r))
-- Assign the arguments to temporaries so the code generator can
diff --git a/compiler/codeGen/CgStackery.lhs b/compiler/codeGen/CgStackery.lhs
index 04fce86f2f..51c0b9095d 100644
--- a/compiler/codeGen/CgStackery.lhs
+++ b/compiler/codeGen/CgStackery.lhs
@@ -289,7 +289,7 @@ pushSpecUpdateFrame lbl updatee code
; MASSERT(case sequel of { OnStack -> True; _ -> False}) }
; dflags <- getDynFlags
; allocStackTop (fixedHdrSize dflags +
- sIZEOF_StgUpdateFrame_NoHdr `quot` wORD_SIZE)
+ sIZEOF_StgUpdateFrame_NoHdr dflags `quot` wORD_SIZE)
; vsp <- getVirtSp
; setStackFrame vsp
; frame_addr <- getSpRelOffset vsp
diff --git a/compiler/codeGen/StgCmmBind.hs b/compiler/codeGen/StgCmmBind.hs
index e3383bb97b..4a144eafac 100644
--- a/compiler/codeGen/StgCmmBind.hs
+++ b/compiler/codeGen/StgCmmBind.hs
@@ -635,7 +635,7 @@ pushUpdateFrame lbl updatee body
dflags <- getDynFlags
let
hdr = fixedHdrSize dflags * wORD_SIZE
- frame = updfr + hdr + sIZEOF_StgUpdateFrame_NoHdr
+ frame = updfr + hdr + sIZEOF_StgUpdateFrame_NoHdr dflags
off_updatee = hdr + oFFSET_StgUpdateFrame_updatee
--
emitStore (CmmStackSlot Old frame) (mkLblExpr lbl)
diff --git a/compiler/codeGen/StgCmmLayout.hs b/compiler/codeGen/StgCmmLayout.hs
index 1469554a8b..a7426284a3 100644
--- a/compiler/codeGen/StgCmmLayout.hs
+++ b/compiler/codeGen/StgCmmLayout.hs
@@ -659,7 +659,7 @@ funInfoTable :: DynFlags -> CmmExpr -> CmmExpr
-- in the info table.
funInfoTable dflags info_ptr
| tablesNextToCode dflags
- = cmmOffsetB dflags info_ptr (- stdInfoTableSizeB dflags - sIZEOF_StgFunInfoExtraRev)
+ = cmmOffsetB dflags info_ptr (- stdInfoTableSizeB dflags - sIZEOF_StgFunInfoExtraRev dflags)
| otherwise
= cmmOffsetW dflags info_ptr (1 + stdInfoTableSizeW dflags)
-- Past the entry code pointer
diff --git a/compiler/codeGen/StgCmmPrim.hs b/compiler/codeGen/StgCmmPrim.hs
index 4efb272ee9..5be88de00b 100644
--- a/compiler/codeGen/StgCmmPrim.hs
+++ b/compiler/codeGen/StgCmmPrim.hs
@@ -1101,7 +1101,7 @@ emitCloneArray :: CLabel -> CmmFormal -> CmmExpr -> CmmExpr -> CmmExpr
emitCloneArray info_p res_r src0 src_off0 n0 = do
dflags <- getDynFlags
let arrPtrsHdrSizeW dflags = mkIntExpr dflags (fixedHdrSize dflags +
- (sIZEOF_StgMutArrPtrs_NoHdr `div` wORD_SIZE))
+ (sIZEOF_StgMutArrPtrs_NoHdr dflags `div` wORD_SIZE))
myCapability = cmmSubWord dflags (CmmReg baseReg) (mkIntExpr dflags oFFSET_Capability_r)
-- Passed as arguments (be careful)
src <- assignTempE src0
diff --git a/includes/mkDerivedConstants.c b/includes/mkDerivedConstants.c
index 6bfd87a8c9..216939d17a 100644
--- a/includes/mkDerivedConstants.c
+++ b/includes/mkDerivedConstants.c
@@ -147,8 +147,6 @@ enum Mode { Gen_Haskell, Gen_Haskell_Type, Gen_Haskell_Value, Gen_Haskell_Wrappe
#define def_size(str, size) \
switch (mode) { \
case Gen_Haskell: \
- printf("sIZEOF_" str " :: Int\n"); \
- printf("sIZEOF_" str " = %" FMT_SizeT "\n", (size_t)size); \
break; \
case Gen_Haskell_Type: \
printf(" , pc_SIZEOF_" str " :: Int\n"); \
@@ -157,11 +155,11 @@ enum Mode { Gen_Haskell, Gen_Haskell_Type, Gen_Haskell_Value, Gen_Haskell_Wrappe
printf(" , pc_SIZEOF_" str " = %" FMT_SizeT "\n", (size_t)size); \
break; \
case Gen_Haskell_Wrappers: \
- printf("-- sIZEOF_" str " :: DynFlags -> Int\n"); \
- printf("-- sIZEOF_" str " dflags = pc_SIZEOF_" str " (sPlatformConstants (settings dflags))\n"); \
+ printf("sIZEOF_" str " :: DynFlags -> Int\n"); \
+ printf("sIZEOF_" str " dflags = pc_SIZEOF_" str " (sPlatformConstants (settings dflags))\n"); \
break; \
case Gen_Haskell_Exports: \
- printf("-- sIZEOF_" str ",\n"); \
+ printf(" sIZEOF_" str ",\n"); \
break; \
case Gen_Header: \
printf("#define SIZEOF_" str " %" FMT_SizeT "\n", (size_t)size); \