-----------------------------------------------------------------------------
--
--- (c) The University of Glasgow, 2004
+-- (c) The University of Glasgow, 2004-2006
--
-- Parser for concrete Cmm.
--
import CgTicky
import CgInfoTbls
import CgForeignCall
-import CgTailCall ( pushUnboxedTuple )
-import CgStackery ( emitPushUpdateFrame )
-import ClosureInfo ( C_SRT(..) )
-import CgCallConv ( smallLiveness )
-import CgClosure ( emitBlackHoleCode )
-import CostCentre ( dontCareCCS )
+import CgTailCall
+import CgStackery
+import ClosureInfo
+import CgCallConv
+import CgClosure
+import CostCentre
import Cmm
import PprCmm
-import CmmUtils ( mkIntCLit )
+import CmmUtils
import CmmLex
import CLabel
import MachOp
-import SMRep ( fixedHdrSize, CgRep(..) )
+import SMRep
import Lexer
-import ForeignCall ( CCallConv(..), Safety(..) )
-import Literal ( mkMachInt )
+import ForeignCall
+import Literal
import Unique
import UniqFM
import SrcLoc
-import DynFlags ( DynFlags, DynFlag(..) )
-import StaticFlags ( opt_SccProfilingOn )
-import ErrUtils ( printError, dumpIfSet_dyn, showPass )
-import StringBuffer ( hGetStringBuffer )
+import DynFlags
+import StaticFlags
+import ErrUtils
+import StringBuffer
import FastString
-import Panic ( panic )
-import Constants ( wORD_SIZE )
+import Panic
+import Constants
import Outputable
-import Monad ( when )
+import Control.Monad
import Data.Char ( ord )
+import System.Exit
#include "HsVersions.h"
}
section "text" = Text
section "data" = Data
section "rodata" = ReadOnlyData
+section "relrodata" = RelocatableReadOnlyData
section "bss" = UninitialisedData
section s = OtherSection s
-- in there we don't want.
case unP cmmParse init_state of
PFailed span err -> do printError span err; return Nothing
- POk _ code -> do
+ POk pst code -> do
cmm <- initC dflags no_module (getCmm (unEC code initEnv [] >> return ()))
- dumpIfSet_dyn dflags Opt_D_dump_cmm "Cmm" (pprCmms [cmm])
+ let ms = getMessages pst
+ printErrorsAndWarnings dflags ms
+ when (errorsFound dflags ms) $ exitWith (ExitFailure 1)
+ dumpIfSet_dyn dflags Opt_D_dump_cmm "Cmm" (pprCmms [cmm])
return (Just cmm)
where
no_module = panic "parseCmmFile: no module"