getConstrTag,
infoTable, infoTableClosureType,
infoTablePtrs, infoTableNonPtrs,
- funInfoTable
+ funInfoTable, makeRelativeRefTo
) where
import Maybes
import Constants
-import Outputable
-
-------------------------------------------------------------------------
--
-- Generating the info table and code for a closure
emitClosureCodeAndInfoTable cl_info args body
= do { ty_descr_lit <-
if opt_SccProfilingOn
- then mkStringCLit (closureTypeDescr cl_info)
+ then do lit <- mkStringCLit (closureTypeDescr cl_info)
+ return (makeRelativeRefTo info_lbl lit)
else return (mkIntCLit 0)
; cl_descr_lit <-
if opt_SccProfilingOn
- then mkStringCLit cl_descr_string
+ then do lit <- mkStringCLit cl_descr_string
+ return (makeRelativeRefTo info_lbl lit)
else return (mkIntCLit 0)
; let std_info = mkStdInfoTable ty_descr_lit cl_descr_lit
cl_type srt_len layout_lit
; conName <-
if is_con
- then do cstr <- mkStringCLit $ fromJust conIdentity
+ then do cstr <- mkByteStringCLit $ fromJust conIdentity
return (makeRelativeRefTo info_lbl cstr)
else return (mkIntCLit 0)
Just con -> -- Constructors don't have an SRT
-- We keep the *zero-indexed* tag in the srt_len
-- field of the info table.
- (mkIntCLit 0, fromIntegral (dataConTagZ con), Just $ dataConIdentity con)
+ (mkIntCLit 0, fromIntegral (dataConTagZ con),
+ Just $ dataConIdentity con)
Nothing -> -- Not a constructor
let (label, len) = srtLabelAndLength srt info_lbl