X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2FcodeGen%2FCgInfoTbls.hs;h=e2e07f94ca440e64e6516391e8dda95af245238e;hb=dd8f4c6420e51736dc2e01d8aebacaa2f255451b;hp=fed5d804e9994e6cd4b4780c9841a00d5dd0eba4;hpb=9ff76535edb25ab7434284adddb5c64708ecb547;p=ghc-hetmet.git diff --git a/compiler/codeGen/CgInfoTbls.hs b/compiler/codeGen/CgInfoTbls.hs index fed5d80..e2e07f9 100644 --- a/compiler/codeGen/CgInfoTbls.hs +++ b/compiler/codeGen/CgInfoTbls.hs @@ -21,7 +21,7 @@ module CgInfoTbls ( getConstrTag, infoTable, infoTableClosureType, infoTablePtrs, infoTableNonPtrs, - funInfoTable + funInfoTable, makeRelativeRefTo ) where @@ -47,8 +47,6 @@ import StaticFlags import Maybes import Constants -import Outputable - ------------------------------------------------------------------------- -- -- Generating the info table and code for a closure @@ -89,7 +87,8 @@ emitClosureCodeAndInfoTable cl_info args body ; conName <- if is_con - then mkStringCLit $ fromJust conIdentity + then do cstr <- mkByteStringCLit $ fromJust conIdentity + return (makeRelativeRefTo info_lbl cstr) else return (mkIntCLit 0) ; emitInfoTableAndCode info_lbl std_info (extra_bits conName) args blks } @@ -110,7 +109,8 @@ emitClosureCodeAndInfoTable cl_info args body 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