Add {-# OPTIONS_GHC -w #-} and some blurb to all compiler modules
[ghc-hetmet.git] / compiler / cmm / CmmParse.y
index 5a56dd3..039c616 100644 (file)
@@ -7,6 +7,13 @@
 -----------------------------------------------------------------------------
 
 {
+{-# OPTIONS_GHC -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/WorkingConventions#Warnings
+-- for details
+
 module CmmParse ( parseCmmFile ) where
 
 import CgMonad
@@ -250,6 +257,19 @@ info       :: { ExtFCode (CLabel, CmmInfoTable, [Maybe LocalReg]) }
                        []) }
                -- we leave most of the fields zero here.  This is only used
                -- to generate the BCO info table in the RTS at the moment.
+
+       -- A variant with a non-zero arity (needed to write Main_main in Cmm)
+       | 'INFO_TABLE_FUN' '(' NAME ',' INT ',' INT ',' INT ',' STRING ',' STRING ',' INT ',' INT ')'
+               -- ptrs, nptrs, closure type, description, type, fun type, arity
+               { do prof <- profilingInfo $11 $13
+                    return (mkRtsEntryLabelFS $3,
+                       CmmInfoTable prof (fromIntegral $9)
+                                    (FunInfo (fromIntegral $5, fromIntegral $7) NoC_SRT (fromIntegral $15) (fromIntegral $17)
+                                     (ArgSpec 0)
+                                     zeroCLit),
+                       []) }
+               -- we leave most of the fields zero here.  This is only used
+               -- to generate the BCO info table in the RTS at the moment.
        
        | 'INFO_TABLE_CONSTR' '(' NAME ',' INT ',' INT ',' INT ',' INT ',' STRING ',' STRING ')'
                -- ptrs, nptrs, tag, closure type, description, type
@@ -878,6 +898,7 @@ foreignCall
 foreignCall conv_string results_code expr_code args_code vols safety ret
   = do  convention <- case conv_string of
           "C" -> return CCallConv
+          "stdcall" -> return StdCallConv
           "C--" -> return CmmCallConv
           _ -> fail ("unknown calling convention: " ++ conv_string)
        return $ do