#include "NCG.h"
import AbsCSyn ( AbstractC(..), Liveness(..), C_SRT(..), needsSRT )
-import CLabel ( CLabel )
-import StgSyn ( SRT(..) )
import ClosureInfo ( closurePtrsSize,
closureNonHdrSize, closureSMRep,
infoTableLabelFromCI,
import BitSet ( BitSet, intBS )
import Maybes ( maybeToBool )
-import Bits
-import Word
-
-#if __GLASGOW_HASKELL__ >= 404
-import GlaExts ( fromInt )
-#endif
+import DATA_BITS
+import DATA_WORD
\end{code}
Generating code for info tables (arrays of data).
\begin{code}
genCodeInfoTable
:: AbstractC
- -> UniqSM StixTreeList
+ -> UniqSM StixStmtList
genCodeInfoTable (CClosureInfoAndCode cl_info _ _ cl_descr)
= returnUs (\xs -> StData PtrRep table : StLabel info_lbl : xs)
-- ToDo: do this using .byte and .word directives.
type_info :: Word32
#ifdef WORDS_BIGENDIAN
- type_info = (fromInt closure_type `shiftL` 16) .|.
- (fromInt srt_len)
+ type_info = (fromIntegral closure_type `shiftL` 16) .|.
+ (fromIntegral srt_len)
#else
- type_info = (fromInt closure_type) .|.
- (fromInt srt_len `shiftL` 16)
+ type_info = (fromIntegral closure_type) .|.
+ (fromIntegral srt_len `shiftL` 16)
#endif
srt = closureSRT cl_info
needs_srt = needsSRT srt
layout_info :: Word32
#ifdef WORDS_BIGENDIAN
- layout_info = (fromInt ptrs `shiftL` 16) .|. fromInt nptrs
+ layout_info = (fromIntegral ptrs `shiftL` 16) .|. fromIntegral nptrs
#else
- layout_info = (fromInt ptrs) .|. (fromInt nptrs `shiftL` 16)
+ layout_info = (fromIntegral ptrs) .|. (fromIntegral nptrs `shiftL` 16)
#endif
ptrs = closurePtrsSize cl_info
-> C_SRT
-> Int
-> Bool -- must include SRT field (i.e. it's a vector)
- -> UniqSM StixTreeList
+ -> UniqSM StixStmtList
genBitmapInfoTable liveness srt closure_type include_srt
= returnUs (\xs -> StData PtrRep table : xs)
type_info :: Word32
#ifdef WORDS_BIGENDIAN
- type_info = (fromInt closure_type `shiftL` 16) .|.
- (fromInt srt_len)
+ type_info = (fromIntegral closure_type `shiftL` 16) .|.
+ (fromIntegral srt_len)
#else
- type_info = (fromInt closure_type) .|.
- (fromInt srt_len `shiftL` 16)
+ type_info = (fromIntegral closure_type) .|.
+ (fromIntegral srt_len `shiftL` 16)
#endif
(srt_label,srt_len) =