import DataCon
import Unique
import StaticFlags
-import FastString
-import Packages
-import Module
import Maybes
import Constants
-import Outputable
-
-import Data.Char
-import Data.Word
-
-------------------------------------------------------------------------
--
-- Generating the info table and code for a closure
--
-- See includes/InfoTables.h
-emitClosureCodeAndInfoTable :: ClosureInfo -> [LocalReg] -> CgStmts -> Code
+emitClosureCodeAndInfoTable :: ClosureInfo -> CmmFormals -> CgStmts -> Code
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
:: CLabel -- Label of info table
-> [CmmLit] -- ...its invariant part
-> [CmmLit] -- ...and its variant part
- -> [LocalReg] -- ...args
+ -> CmmFormals -- ...args
-> [CmmBasicBlock] -- ...and body
-> Code