change of representation for GenCmm, GenCmmTop, CmmProc
[ghc-hetmet.git] / compiler / cmm / CLabel.hs
index a67e587..28c43e1 100644 (file)
@@ -6,6 +6,13 @@
 --
 -----------------------------------------------------------------------------
 
+{-# OPTIONS -w #-}
+-- The above warning supression flag is a temporary kludge.
+-- While working on this module you are encouraged to remove it and fix
+-- any warnings in the module. See
+--     http://hackage.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#Warnings
+-- for details
+
 module CLabel (
        CLabel, -- abstract type
 
@@ -82,6 +89,7 @@ module CLabel (
        mkRtsApFastLabel,
 
        mkForeignLabel,
+        addLabelSize,
 
        mkCCLabel, mkCCSLabel,
 
@@ -357,6 +365,12 @@ mkApEntryLabel upd off             = RtsLabel (RtsApEntry   upd off)
 mkForeignLabel :: FastString -> Maybe Int -> Bool -> CLabel
 mkForeignLabel str mb_sz  is_dynamic = ForeignLabel str mb_sz is_dynamic
 
+addLabelSize :: CLabel -> Int -> CLabel
+addLabelSize (ForeignLabel str _ is_dynamic) sz
+  = ForeignLabel str (Just sz) is_dynamic
+addLabelSize label _
+  = label
+
        -- Cost centres etc.
 
 mkCCLabel      cc              = CC_Label cc