[commit: ghc] master: Use sIZEOF_* from platformConstants rather than Constants (4279ab5)

Ian Lynagh <[email protected]>
Newsgroups gmane.comp.lang.haskell.cvs.ghc
Message-ID <[email protected]>
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/4279ab5050df28ba7abd79296a788d1ddb9eb5df

>---------------------------------------------------------------

commit 4279ab5050df28ba7abd79296a788d1ddb9eb5df
Author: Ian Lynagh <[email protected]>
Date:   Thu Sep 13 19:12:30 2012 +0100

    Use sIZEOF_* from platformConstants rather than Constants

>---------------------------------------------------------------

 compiler/cmm/SMRep.lhs           |    6 +++---
 compiler/codeGen/CgInfoTbls.hs   |    2 +-
 compiler/codeGen/CgPrimOp.hs     |    2 +-
 compiler/codeGen/CgStackery.lhs  |    2 +-
 compiler/codeGen/StgCmmBind.hs   |    2 +-
 compiler/codeGen/StgCmmLayout.hs |    2 +-
 compiler/codeGen/StgCmmPrim.hs   |    2 +-
 includes/mkDerivedConstants.c    |    8 +++-----
 8 files changed, 12 insertions(+), 14 deletions(-)

diff --git a/compiler/cmm/SMRep.lhs b/compiler/cmm/SMRep.lhs
index 1d5574a..68effd7 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 18e3532..ce4228e 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 1accdbe..1d2359a 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 04fce86..51c0b90 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 e3383bb..4a144ea 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 1469554..a742628 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 4efb272..5be88de 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 6bfd87a..216939d 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);    \
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.