summaryrefslogtreecommitdiff
path: root/compiler/codeGen/CgUtils.hs
diff options
context:
space:
mode:
authorIan Lynagh <ian@well-typed.com>2012-09-18 23:22:20 +0100
committerIan Lynagh <ian@well-typed.com>2012-09-18 23:22:20 +0100
commita9b986e2fe285f844e42e573e4887a4e36ba92d4 (patch)
tree30509b6c6aa091125089208631c146ca72793758 /compiler/codeGen/CgUtils.hs
parent3a4c64c1a2953bbc759a6f5c99dad31ab50dc96b (diff)
downloadhaskell-a9b986e2fe285f844e42e573e4887a4e36ba92d4.tar.gz
Make StgWord a portable type too
StgWord is a newtyped Word64, as it needed to be something that has a UArray instance.
Diffstat (limited to 'compiler/codeGen/CgUtils.hs')
-rw-r--r--compiler/codeGen/CgUtils.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/codeGen/CgUtils.hs b/compiler/codeGen/CgUtils.hs
index 2abdb0e589..aee4c7b5b3 100644
--- a/compiler/codeGen/CgUtils.hs
+++ b/compiler/codeGen/CgUtils.hs
@@ -795,17 +795,17 @@ getSRTInfo = do
NoSRT -> return NoC_SRT
SRTEntries {} -> panic "getSRTInfo: SRTEntries. Perhaps you forgot to run SimplStg?"
SRT off len bmp
- | len > hALF_WORD_SIZE_IN_BITS || bmp == [fromInteger (fromStgHalfWord (srt_escape dflags))]
+ | len > hALF_WORD_SIZE_IN_BITS || bmp == [toStgWord dflags (fromStgHalfWord (srt_escape dflags))]
-> do id <- newUnique
let srt_desc_lbl = mkLargeSRTLabel id
emitRODataLits "getSRTInfo" srt_desc_lbl
( cmmLabelOffW dflags srt_lbl off
- : mkWordCLit dflags (fromIntegral len)
+ : mkWordCLit dflags (toStgWord dflags (toInteger len))
: map (mkWordCLit dflags) bmp)
return (C_SRT srt_desc_lbl 0 (srt_escape dflags))
| otherwise
- -> return (C_SRT srt_lbl off (toStgHalfWord dflags (toInteger (head bmp))))
+ -> return (C_SRT srt_lbl off (toStgHalfWord dflags (fromStgWord (head bmp))))
-- The fromIntegral converts to StgHalfWord
srt_escape :: DynFlags -> StgHalfWord