- cmm <- initC dflags no_module (getCmm (unEC code initEnv [] >> return ()))
- let ms = getMessages pst
- printErrorsAndWarnings dflags ms
- when (errorsFound dflags ms) $ exitWith (ExitFailure 1)
- dumpIfSet_dyn dflags Opt_D_dump_cmm "Cmm" (ppr cmm)
- return (Just cmm)
+ cmm <- initC dflags no_module (getCmm (unEC code initEnv [] >> return ()))
+ let ms = getMessages pst
+ if (errorsFound dflags ms)
+ then return (ms, Nothing)
+ else do
+ dumpIfSet_dyn dflags Opt_D_dump_cmm "Cmm" (ppr cmm)
+ return (ms, Just cmm)