genCodeInfoTable: don't do getSRTInfo on the closure info if we already
know via infoTblNeedsSRT that an SRT isn't needed.
= returnUs (\xs -> StData PtrRep table : StLabel info_lbl : xs)
where
= returnUs (\xs -> StData PtrRep table : StLabel info_lbl : xs)
where
- info_lbl = infoTableLabelFromCI cl_info
+ info_lbl = infoTableLabelFromCI cl_info
+ needs_srt = infoTblNeedsSRT cl_info
- table | infoTblNeedsSRT cl_info = srt_label : rest_of_table
- | otherwise = rest_of_table
+ table | needs_srt = srt_label : rest_of_table
+ | otherwise = rest_of_table
#endif
srt = getSRTInfo cl_info
#endif
srt = getSRTInfo cl_info
- (srt_label,srt_len) =
- case srt of
- (lbl, NoSRT) -> (StInt 0, 0)
+ (srt_label,srt_len)
+ | needs_srt
+ = case srt of
(lbl, SRT off len) ->
(StIndex DataPtrRep (StCLbl lbl)
(StInt (toInteger off)), len)
(lbl, SRT off len) ->
(StIndex DataPtrRep (StCLbl lbl)
(StInt (toInteger off)), len)
+ | otherwise
+ = (StInt 0, 0)
layout_info :: Word32
#ifdef WORDS_BIGENDIAN
layout_info :: Word32
#ifdef WORDS_BIGENDIAN