[project @ 2005-08-02 12:01:57 by simonmar]
[ghc-hetmet.git] / ghc / compiler / cmm / CmmParse.y
index 3ae93ff..45f411b 100644 (file)
@@ -38,6 +38,7 @@ import Unique
 import UniqFM
 import SrcLoc
 import DynFlags                ( DynFlags, DynFlag(..) )
+import Packages                ( HomeModules )
 import StaticFlags     ( opt_SccProfilingOn )
 import ErrUtils                ( printError, dumpIfSet_dyn, showPass )
 import StringBuffer    ( hGetStringBuffer )
@@ -294,6 +295,7 @@ bool_op :: { ExtFCode BoolExpr }
 -- This is not C-- syntax.  What to do?
 vols   :: { Maybe [GlobalReg] }
        : {- empty -}                   { Nothing }
+       | '[' ']'                       { Just [] }
        | '[' globals ']'               { Just $2 }
 
 globals :: { [GlobalReg] }
@@ -861,8 +863,8 @@ initEnv = listToUFM [
         CmmLit (CmmInt (fromIntegral stdInfoTableSizeB) wordRep) )
   ]
 
-parseCmmFile :: DynFlags -> FilePath -> IO (Maybe Cmm)
-parseCmmFile dflags filename = do
+parseCmmFile :: DynFlags -> HomeModules -> FilePath -> IO (Maybe Cmm)
+parseCmmFile dflags hmods filename = do
   showPass dflags "ParseCmm"
   buf <- hGetStringBuffer filename
   let
@@ -873,10 +875,9 @@ parseCmmFile dflags filename = do
   case unP cmmParse init_state of
     PFailed span err -> do printError span err; return Nothing
     POk _ code -> do
-       cmm <- initC dflags no_module (getCmm (unEC code initEnv [] >> return ()))
+       cmm <- initC dflags hmods no_module (getCmm (unEC code initEnv [] >> return ()))
        dumpIfSet_dyn dflags Opt_D_dump_cmm "Cmm" (pprCmms [cmm])
        return (Just cmm)
   where
        no_module = panic "parseCmmFile: no module"
-
 }