[project @ 2001-02-13 15:51:57 by sewardj]
[ghc-hetmet.git] / ghc / compiler / nativeGen / StixInfo.lhs
index 61bd8ec..bb26435 100644 (file)
@@ -14,14 +14,14 @@ import StgSyn               ( SRT(..) )
 import ClosureInfo     ( closurePtrsSize,
                          closureNonHdrSize, closureSMRep,
                          infoTableLabelFromCI,
-                         infoTblNeedsSRT, getSRTInfo
+                         infoTblNeedsSRT, getSRTInfo, closureSemiTag
                        )
 import PrimRep         ( PrimRep(..) )
-import SMRep           ( SMRep(..), getSMRepClosureTypeInt )
+import SMRep           ( getSMRepClosureTypeInt )
 import Stix            -- all of it
 import UniqSupply      ( returnUs, UniqSM )
-import Outputable      ( int )
 import BitSet          ( intBS )
+import Maybes          ( maybeToBool )
 
 import Bits
 import Word
@@ -68,6 +68,8 @@ genCodeInfoTable (CClosureInfoAndCode cl_info _ _ cl_descr)
        srt = getSRTInfo cl_info             
 
        (srt_label,srt_len)
+           | is_constr
+           = (StInt 0, tag)
            | needs_srt
           = case srt of
                (lbl, SRT off len) -> 
@@ -76,6 +78,10 @@ genCodeInfoTable (CClosureInfoAndCode cl_info _ _ cl_descr)
            | otherwise
            = (StInt 0, 0)
 
+        maybe_tag = closureSemiTag cl_info
+        is_constr = maybeToBool maybe_tag
+        (Just tag) = maybe_tag
+
        layout_info :: Word32
 #ifdef WORDS_BIGENDIAN
        layout_info = (fromInt ptrs `shiftL` 16) .|. fromInt nptrs