Use OPTIONS rather than OPTIONS_GHC for pragmas
[ghc-hetmet.git] / compiler / ghci / ByteCodeInstr.lhs
index 3f57d18..3c2d10d 100644 (file)
@@ -4,6 +4,15 @@
 ByteCodeInstrs: Bytecode instruction definitions
 
 \begin{code}
+{-# OPTIONS_GHC -funbox-strict-fields #-}
+
+{-# 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/CodingStyle#Warnings
+-- for details
+
 module ByteCodeInstr ( 
        BCInstr(..), ProtoBCO(..), bciStackUse, BreakInfo (..) 
   ) where
@@ -13,6 +22,7 @@ module ByteCodeInstr (
 
 import ByteCodeItbls   ( ItblPtr )
 
+import Type
 import Outputable
 import Name
 import Id
@@ -54,9 +64,9 @@ data BCInstr
    = STKCHECK  Int
 
    -- Push locals (existing bits of the stack)
-   | PUSH_L    Int{-offset-}
-   | PUSH_LL   Int Int{-2 offsets-}
-   | PUSH_LLL  Int Int Int{-3 offsets-}
+   | PUSH_L    !Int{-offset-}
+   | PUSH_LL   !Int !Int{-2 offsets-}
+   | PUSH_LLL  !Int !Int !Int{-3 offsets-}
 
    -- Push a ptr  (these all map to PUSH_G really)
    | PUSH_G       Name
@@ -94,12 +104,12 @@ data BCInstr
    | SLIDE     Int{-this many-} Int{-down by this much-}
 
    -- To do with the heap
-   | ALLOC_AP  Int     -- make an AP with this many payload words
-   | ALLOC_PAP Int Int -- make a PAP with this arity / payload words
-   | MKAP      Int{-ptr to AP is this far down stack-} Int{-# words-}
-   | MKPAP     Int{-ptr to PAP is this far down stack-} Int{-# words-}
-   | UNPACK    Int     -- unpack N words from t.o.s Constr
-   | PACK      DataCon Int
+   | ALLOC_AP  !Int    -- make an AP with this many payload words
+   | ALLOC_PAP !Int !Int       -- make a PAP with this arity / payload words
+   | MKAP      !Int{-ptr to AP is this far down stack-} !Int{-# words-}
+   | MKPAP     !Int{-ptr to PAP is this far down stack-} !Int{-# words-}
+   | UNPACK    !Int    -- unpack N words from t.o.s Constr
+   | PACK      DataCon !Int
                        -- after assembly, the DataCon is an index into the
                        -- itbl array
    -- For doing case trees
@@ -139,15 +149,17 @@ data BCInstr
 data BreakInfo 
    = BreakInfo
    { breakInfo_module :: Module
-   , breakInfo_number :: Int
+   , breakInfo_number :: {-# UNPACK #-} !Int
    , breakInfo_vars   :: [(Id,Int)]
+   , breakInfo_resty  :: Type
    }
 
 instance Outputable BreakInfo where
    ppr info = text "BreakInfo" <+>
               parens (ppr (breakInfo_module info) <+>
                       ppr (breakInfo_number info) <+>
-                      ppr (breakInfo_vars info))
+                      ppr (breakInfo_vars info) <+>
+                      ppr (breakInfo_resty info))
 
 -- -----------------------------------------------------------------------------
 -- Printing bytecode instructions