[project @ 2000-10-11 16:45:53 by sewardj]
[ghc-hetmet.git] / ghc / compiler / nativeGen / StixInfo.lhs
index 3bf427e..16feabc 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 Stix            -- all of it
 import UniqSupply      ( returnUs, UniqSM )
-import Outputable      ( int )
 import BitSet          ( intBS )
+import Maybes          ( maybeToBool )
 
 import Bits
 import Word
@@ -59,17 +59,17 @@ genCodeInfoTable (CClosureInfoAndCode cl_info _ _ cl_descr)
        -- ToDo: do this using .byte and .word directives.
        type_info :: Word32
 #ifdef WORDS_BIGENDIAN
-        type_info = (fromInt flags `shiftL` 24) .|.
-                   (fromInt closure_type `shiftL` 16) .|.
+        type_info = (fromInt closure_type `shiftL` 16) .|.
                    (fromInt srt_len)
 #else 
-        type_info = (fromInt flags) .|.
-                   (fromInt closure_type `shiftL` 8) .|.
+        type_info = (fromInt closure_type) .|.
                    (fromInt srt_len `shiftL` 16)
 #endif      
        srt = getSRTInfo cl_info             
 
        (srt_label,srt_len)
+           | is_constr
+           = (StInt 0, tag)
            | needs_srt
           = case srt of
                (lbl, SRT off len) -> 
@@ -78,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
@@ -92,7 +96,6 @@ genCodeInfoTable (CClosureInfoAndCode cl_info _ _ cl_descr)
 
        closure_type = getSMRepClosureTypeInt (closureSMRep cl_info)
 
-       flags = 0 -- for now
 
 
 genBitmapInfoTable
@@ -124,12 +127,10 @@ genBitmapInfoTable liveness srt closure_type include_srt
 
        type_info :: Word32
 #ifdef WORDS_BIGENDIAN
-        type_info = (fromInt flags `shiftL` 24) .|.
-                   (fromInt closure_type `shiftL` 16) .|.
+        type_info = (fromInt closure_type `shiftL` 16) .|.
                    (fromInt srt_len)
 #else 
-        type_info = (fromInt flags) .|.
-                   (fromInt closure_type `shiftL` 8) .|.
+        type_info = (fromInt closure_type) .|.
                    (fromInt srt_len `shiftL` 16)
 #endif      
 
@@ -139,6 +140,4 @@ genBitmapInfoTable liveness srt closure_type include_srt
                (lbl, SRT off len) -> 
                        (StIndex DataPtrRep (StCLbl lbl) 
                                (StInt (toInteger off)), len)
-
-       flags = 0 -- for now
 \end{code}