{-# LANGUAGE DeriveFunctor #-}
module GHC.Core.Opt.Monad (
FloatOutSwitches(..),
CoreM, runCoreM,
mapDynFlagsCoreM, dropSimplCount,
getHscEnv, getModule,
initRuleEnv, getExternalRuleBase,
getDynFlags, getPackageFamInstEnv,
getInteractiveContext,
getUniqMask,
getNamePprCtx, getSrcSpanM,
addSimplCount,
liftIO, liftIOWithCount,
getAnnotations, getFirstAnnotations,
putMsg, putMsgS, errorMsg, msg,
fatalErrorMsg, fatalErrorMsgS,
debugTraceMsg, debugTraceMsgS,
) where
import GHC.Prelude hiding ( read )
import GHC.Driver.Session
import GHC.Driver.Env
import GHC.Core.Rules ( RuleBase, RuleEnv, mkRuleEnv )
import GHC.Core.Opt.Stats ( SimplCount, zeroSimplCount, plusSimplCount )
import GHC.Types.Annotations
import GHC.Types.Unique.Supply
import GHC.Types.Name.Env
import GHC.Types.SrcLoc
import GHC.Types.Error
import GHC.Utils.Error ( errorDiagnostic )
import GHC.Utils.Outputable as Outputable
import GHC.Utils.Logger
import GHC.Utils.Monad
import GHC.Data.IOEnv hiding ( liftIO, failM, failWithM )
import qualified GHC.Data.IOEnv as IOEnv
import GHC.Runtime.Context ( InteractiveContext )
import GHC.Unit.Module
import GHC.Unit.Module.ModGuts
import GHC.Unit.External
import Data.Bifunctor ( bimap )
import Data.Dynamic
import Data.Maybe (listToMaybe)
import Data.Word
import Control.Monad
import Control.Applicative ( Alternative(..) )
data FloatOutSwitches = FloatOutSwitches {
FloatOutSwitches -> Maybe Int
floatOutLambdas :: Maybe Int,
FloatOutSwitches -> Bool
floatOutConstants :: Bool,
FloatOutSwitches -> Bool
floatOutOverSatApps :: Bool,
FloatOutSwitches -> Bool
floatToTopLevelOnly :: Bool
}
instance Outputable FloatOutSwitches where
ppr :: FloatOutSwitches -> SDoc
ppr = FloatOutSwitches -> SDoc
pprFloatOutSwitches
pprFloatOutSwitches :: FloatOutSwitches -> SDoc
pprFloatOutSwitches :: FloatOutSwitches -> SDoc
pprFloatOutSwitches FloatOutSwitches
sw
= forall doc. IsLine doc => String -> doc
text String
"FOS" forall doc. IsLine doc => doc -> doc -> doc
<+> (forall doc. IsLine doc => doc -> doc
braces forall a b. (a -> b) -> a -> b
$
forall doc. IsLine doc => [doc] -> doc
sep forall a b. (a -> b) -> a -> b
$ forall doc. IsLine doc => doc -> [doc] -> [doc]
punctuate forall doc. IsLine doc => doc
comma forall a b. (a -> b) -> a -> b
$
[ forall doc. IsLine doc => String -> doc
text String
"Lam =" forall doc. IsLine doc => doc -> doc -> doc
<+> forall a. Outputable a => a -> SDoc
ppr (FloatOutSwitches -> Maybe Int
floatOutLambdas FloatOutSwitches
sw)
, forall doc. IsLine doc => String -> doc
text String
"Consts =" forall doc. IsLine doc => doc -> doc -> doc
<+> forall a. Outputable a => a -> SDoc
ppr (FloatOutSwitches -> Bool
floatOutConstants FloatOutSwitches
sw)
, forall doc. IsLine doc => String -> doc
text String
"OverSatApps =" forall doc. IsLine doc => doc -> doc -> doc
<+> forall a. Outputable a => a -> SDoc
ppr (FloatOutSwitches -> Bool
floatOutOverSatApps FloatOutSwitches
sw) ])
data CoreReader = CoreReader {
CoreReader -> HscEnv
cr_hsc_env :: HscEnv,
CoreReader -> RuleBase
cr_rule_base :: RuleBase,
CoreReader -> Module
cr_module :: Module,
CoreReader -> NamePprCtx
cr_name_ppr_ctx :: NamePprCtx,
CoreReader -> SrcSpan
cr_loc :: SrcSpan,
CoreReader -> Char
cr_uniq_mask :: !Char
}
newtype CoreWriter = CoreWriter {
CoreWriter -> SimplCount
cw_simpl_count :: SimplCount
}
emptyWriter :: Bool
-> CoreWriter
emptyWriter :: Bool -> CoreWriter
emptyWriter Bool
dump_simpl_stats = CoreWriter {
cw_simpl_count :: SimplCount
cw_simpl_count = Bool -> SimplCount
zeroSimplCount Bool
dump_simpl_stats
}
plusWriter :: CoreWriter -> CoreWriter -> CoreWriter
plusWriter :: CoreWriter -> CoreWriter -> CoreWriter
plusWriter CoreWriter
w1 CoreWriter
w2 = CoreWriter {
cw_simpl_count :: SimplCount
cw_simpl_count = (CoreWriter -> SimplCount
cw_simpl_count CoreWriter
w1) SimplCount -> SimplCount -> SimplCount
`plusSimplCount` (CoreWriter -> SimplCount
cw_simpl_count CoreWriter
w2)
}
type CoreIOEnv = IOEnv CoreReader
newtype CoreM a = CoreM { forall a. CoreM a -> CoreIOEnv (a, CoreWriter)
unCoreM :: CoreIOEnv (a, CoreWriter) }
deriving (forall a b. a -> CoreM b -> CoreM a
forall a b. (a -> b) -> CoreM a -> CoreM b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
<$ :: forall a b. a -> CoreM b -> CoreM a
$c<$ :: forall a b. a -> CoreM b -> CoreM a
fmap :: forall a b. (a -> b) -> CoreM a -> CoreM b
$cfmap :: forall a b. (a -> b) -> CoreM a -> CoreM b
Functor)
instance Monad CoreM where
CoreM a
mx >>= :: forall a b. CoreM a -> (a -> CoreM b) -> CoreM b
>>= a -> CoreM b
f = forall a. CoreIOEnv (a, CoreWriter) -> CoreM a
CoreM forall a b. (a -> b) -> a -> b
$ do
(a
x, CoreWriter
w1) <- forall a. CoreM a -> CoreIOEnv (a, CoreWriter)
unCoreM CoreM a
mx
(b
y, CoreWriter
w2) <- forall a. CoreM a -> CoreIOEnv (a, CoreWriter)
unCoreM (a -> CoreM b
f a
x)
let w :: CoreWriter
w = CoreWriter
w1 CoreWriter -> CoreWriter -> CoreWriter
`plusWriter` CoreWriter
w2
forall (m :: * -> *) a. Monad m => a -> m a
return forall a b. (a -> b) -> a -> b
$ seq :: forall a b. a -> b -> b
seq CoreWriter
w (b
y, CoreWriter
w)
instance Applicative CoreM where
pure :: forall a. a -> CoreM a
pure a
x = forall a. CoreIOEnv (a, CoreWriter) -> CoreM a
CoreM forall a b. (a -> b) -> a -> b
$ forall a. a -> CoreIOEnv (a, CoreWriter)
nop a
x
<*> :: forall a b. CoreM (a -> b) -> CoreM a -> CoreM b
(<*>) = forall (m :: * -> *) a b. Monad m => m (a -> b) -> m a -> m b
ap
CoreM a
m *> :: forall a b. CoreM a -> CoreM b -> CoreM b
*> CoreM b
k = CoreM a
m forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= \a
_ -> CoreM b
k
instance Alternative CoreM where
empty :: forall a. CoreM a
empty = forall a. CoreIOEnv (a, CoreWriter) -> CoreM a
CoreM forall (f :: * -> *) a. Alternative f => f a
Control.Applicative.empty
CoreM a
m <|> :: forall a. CoreM a -> CoreM a -> CoreM a
<|> CoreM a
n = forall a. CoreIOEnv (a, CoreWriter) -> CoreM a
CoreM (forall a. CoreM a -> CoreIOEnv (a, CoreWriter)
unCoreM CoreM a
m forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
<|> forall a. CoreM a -> CoreIOEnv (a, CoreWriter)
unCoreM CoreM a
n)
instance MonadPlus CoreM
instance MonadUnique CoreM where
getUniqueSupplyM :: CoreM UniqSupply
getUniqueSupplyM = do
Char
mask <- forall a. (CoreReader -> a) -> CoreM a
read CoreReader -> Char
cr_uniq_mask
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$! Char -> IO UniqSupply
mkSplitUniqSupply Char
mask
getUniqueM :: CoreM Unique
getUniqueM = do
Char
mask <- forall a. (CoreReader -> a) -> CoreM a
read CoreReader -> Char
cr_uniq_mask
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$! Char -> IO Unique
uniqFromMask Char
mask
runCoreM :: HscEnv
-> RuleBase
-> Char
-> Module
-> NamePprCtx
-> SrcSpan
-> CoreM a
-> IO (a, SimplCount)
runCoreM :: forall a.
HscEnv
-> RuleBase
-> Char
-> Module
-> NamePprCtx
-> SrcSpan
-> CoreM a
-> IO (a, SimplCount)
runCoreM HscEnv
hsc_env RuleBase
rule_base Char
mask Module
mod NamePprCtx
name_ppr_ctx SrcSpan
loc CoreM a
m
= forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM forall a. (a, CoreWriter) -> (a, SimplCount)
extract forall a b. (a -> b) -> a -> b
$ forall env a. env -> IOEnv env a -> IO a
runIOEnv CoreReader
reader forall a b. (a -> b) -> a -> b
$ forall a. CoreM a -> CoreIOEnv (a, CoreWriter)
unCoreM CoreM a
m
where
reader :: CoreReader
reader = CoreReader {
cr_hsc_env :: HscEnv
cr_hsc_env = HscEnv
hsc_env,
cr_rule_base :: RuleBase
cr_rule_base = RuleBase
rule_base,
cr_module :: Module
cr_module = Module
mod,
cr_name_ppr_ctx :: NamePprCtx
cr_name_ppr_ctx = NamePprCtx
name_ppr_ctx,
cr_loc :: SrcSpan
cr_loc = SrcSpan
loc,
cr_uniq_mask :: Char
cr_uniq_mask = Char
mask
}
extract :: (a, CoreWriter) -> (a, SimplCount)
extract :: forall a. (a, CoreWriter) -> (a, SimplCount)
extract (a
value, CoreWriter
writer) = (a
value, CoreWriter -> SimplCount
cw_simpl_count CoreWriter
writer)
nop :: a -> CoreIOEnv (a, CoreWriter)
nop :: forall a. a -> CoreIOEnv (a, CoreWriter)
nop a
x = do
Logger
logger <- HscEnv -> Logger
hsc_logger forall b c a. (b -> c) -> (a -> b) -> a -> c
. CoreReader -> HscEnv
cr_hsc_env forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall env. IOEnv env env
getEnv
forall (m :: * -> *) a. Monad m => a -> m a
return (a
x, Bool -> CoreWriter
emptyWriter forall a b. (a -> b) -> a -> b
$ Logger -> DumpFlag -> Bool
logHasDumpFlag Logger
logger DumpFlag
Opt_D_dump_simpl_stats)
read :: (CoreReader -> a) -> CoreM a
read :: forall a. (CoreReader -> a) -> CoreM a
read CoreReader -> a
f = forall a. CoreIOEnv (a, CoreWriter) -> CoreM a
CoreM forall a b. (a -> b) -> a -> b
$ forall env. IOEnv env env
getEnv forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= (\CoreReader
r -> forall a. a -> CoreIOEnv (a, CoreWriter)
nop (CoreReader -> a
f CoreReader
r))
write :: CoreWriter -> CoreM ()
write :: CoreWriter -> CoreM ()
write CoreWriter
w = forall a. CoreIOEnv (a, CoreWriter) -> CoreM a
CoreM forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a. Monad m => a -> m a
return ((), CoreWriter
w)
liftIOEnv :: CoreIOEnv a -> CoreM a
liftIOEnv :: forall a. CoreIOEnv a -> CoreM a
liftIOEnv CoreIOEnv a
mx = forall a. CoreIOEnv (a, CoreWriter) -> CoreM a
CoreM (CoreIOEnv a
mx forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= (\a
x -> forall a. a -> CoreIOEnv (a, CoreWriter)
nop a
x))
instance MonadIO CoreM where
liftIO :: forall a. IO a -> CoreM a
liftIO = forall a. CoreIOEnv a -> CoreM a
liftIOEnv forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) a. MonadIO m => IO a -> m a
IOEnv.liftIO
liftIOWithCount :: IO (SimplCount, a) -> CoreM a
liftIOWithCount :: forall a. IO (SimplCount, a) -> CoreM a
liftIOWithCount IO (SimplCount, a)
what = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO IO (SimplCount, a)
what forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= (\(SimplCount
count, a
x) -> SimplCount -> CoreM ()
addSimplCount SimplCount
count forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> forall (m :: * -> *) a. Monad m => a -> m a
return a
x)
getHscEnv :: CoreM HscEnv
getHscEnv :: CoreM HscEnv
getHscEnv = forall a. (CoreReader -> a) -> CoreM a
read CoreReader -> HscEnv
cr_hsc_env
getHomeRuleBase :: CoreM RuleBase
getHomeRuleBase :: CoreM RuleBase
getHomeRuleBase = forall a. (CoreReader -> a) -> CoreM a
read CoreReader -> RuleBase
cr_rule_base
initRuleEnv :: ModGuts -> CoreM RuleEnv
initRuleEnv :: ModGuts -> CoreM RuleEnv
initRuleEnv ModGuts
guts
= do { RuleBase
hpt_rules <- CoreM RuleBase
getHomeRuleBase
; RuleBase
eps_rules <- CoreM RuleBase
getExternalRuleBase
; forall (m :: * -> *) a. Monad m => a -> m a
return (ModGuts -> RuleBase -> RuleBase -> RuleEnv
mkRuleEnv ModGuts
guts RuleBase
eps_rules RuleBase
hpt_rules) }
getExternalRuleBase :: CoreM RuleBase
getExternalRuleBase :: CoreM RuleBase
getExternalRuleBase = ExternalPackageState -> RuleBase
eps_rule_base forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> CoreM ExternalPackageState
get_eps
getNamePprCtx :: CoreM NamePprCtx
getNamePprCtx :: CoreM NamePprCtx
getNamePprCtx = forall a. (CoreReader -> a) -> CoreM a
read CoreReader -> NamePprCtx
cr_name_ppr_ctx
getSrcSpanM :: CoreM SrcSpan
getSrcSpanM :: CoreM SrcSpan
getSrcSpanM = forall a. (CoreReader -> a) -> CoreM a
read CoreReader -> SrcSpan
cr_loc
addSimplCount :: SimplCount -> CoreM ()
addSimplCount :: SimplCount -> CoreM ()
addSimplCount SimplCount
count = CoreWriter -> CoreM ()
write (CoreWriter { cw_simpl_count :: SimplCount
cw_simpl_count = SimplCount
count })
getUniqMask :: CoreM Char
getUniqMask :: CoreM Char
getUniqMask = forall a. (CoreReader -> a) -> CoreM a
read CoreReader -> Char
cr_uniq_mask
mapDynFlagsCoreM :: (DynFlags -> DynFlags) -> CoreM a -> CoreM a
mapDynFlagsCoreM :: forall a. (DynFlags -> DynFlags) -> CoreM a -> CoreM a
mapDynFlagsCoreM DynFlags -> DynFlags
f CoreM a
m = forall a. CoreIOEnv (a, CoreWriter) -> CoreM a
CoreM forall a b. (a -> b) -> a -> b
$ do
!CoreReader
e <- forall env. IOEnv env env
getEnv
let !e' :: CoreReader
e' = CoreReader
e { cr_hsc_env :: HscEnv
cr_hsc_env = (DynFlags -> DynFlags) -> HscEnv -> HscEnv
hscUpdateFlags DynFlags -> DynFlags
f forall a b. (a -> b) -> a -> b
$ CoreReader -> HscEnv
cr_hsc_env CoreReader
e }
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ forall env a. env -> IOEnv env a -> IO a
runIOEnv CoreReader
e' forall a b. (a -> b) -> a -> b
$! forall a. CoreM a -> CoreIOEnv (a, CoreWriter)
unCoreM CoreM a
m
dropSimplCount :: CoreM a -> CoreM a
dropSimplCount :: forall a. CoreM a -> CoreM a
dropSimplCount CoreM a
m = forall a. CoreIOEnv (a, CoreWriter) -> CoreM a
CoreM forall a b. (a -> b) -> a -> b
$ do
(a
a, CoreWriter
_) <- forall a. CoreM a -> CoreIOEnv (a, CoreWriter)
unCoreM CoreM a
m
forall a. CoreM a -> CoreIOEnv (a, CoreWriter)
unCoreM forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *) a. Applicative f => a -> f a
pure a
a
instance HasDynFlags CoreM where
getDynFlags :: CoreM DynFlags
getDynFlags = forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap HscEnv -> DynFlags
hsc_dflags CoreM HscEnv
getHscEnv
instance HasLogger CoreM where
getLogger :: CoreM Logger
getLogger = forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap HscEnv -> Logger
hsc_logger CoreM HscEnv
getHscEnv
instance HasModule CoreM where
getModule :: CoreM Module
getModule = forall a. (CoreReader -> a) -> CoreM a
read CoreReader -> Module
cr_module
getInteractiveContext :: CoreM InteractiveContext
getInteractiveContext :: CoreM InteractiveContext
getInteractiveContext = HscEnv -> InteractiveContext
hsc_IC forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> CoreM HscEnv
getHscEnv
getPackageFamInstEnv :: CoreM PackageFamInstEnv
getPackageFamInstEnv :: CoreM PackageFamInstEnv
getPackageFamInstEnv = ExternalPackageState -> PackageFamInstEnv
eps_fam_inst_env forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> CoreM ExternalPackageState
get_eps
get_eps :: CoreM ExternalPackageState
get_eps :: CoreM ExternalPackageState
get_eps = do
HscEnv
hsc_env <- CoreM HscEnv
getHscEnv
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ HscEnv -> IO ExternalPackageState
hscEPS HscEnv
hsc_env
getAnnotations :: Typeable a => ([Word8] -> a) -> ModGuts -> CoreM (ModuleEnv [a], NameEnv [a])
getAnnotations :: forall a.
Typeable a =>
([Word8] -> a) -> ModGuts -> CoreM (ModuleEnv [a], NameEnv [a])
getAnnotations [Word8] -> a
deserialize ModGuts
guts = do
HscEnv
hsc_env <- CoreM HscEnv
getHscEnv
AnnEnv
ann_env <- forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ HscEnv -> Maybe ModGuts -> IO AnnEnv
prepareAnnotations HscEnv
hsc_env (forall a. a -> Maybe a
Just ModGuts
guts)
forall (m :: * -> *) a. Monad m => a -> m a
return (forall a.
Typeable a =>
([Word8] -> a) -> AnnEnv -> (ModuleEnv [a], NameEnv [a])
deserializeAnns [Word8] -> a
deserialize AnnEnv
ann_env)
getFirstAnnotations :: Typeable a => ([Word8] -> a) -> ModGuts -> CoreM (ModuleEnv a, NameEnv a)
getFirstAnnotations :: forall a.
Typeable a =>
([Word8] -> a) -> ModGuts -> CoreM (ModuleEnv a, NameEnv a)
getFirstAnnotations [Word8] -> a
deserialize ModGuts
guts
= forall (p :: * -> * -> *) a b c d.
Bifunctor p =>
(a -> b) -> (c -> d) -> p a c -> p b d
bimap forall {b}. ModuleEnv [b] -> ModuleEnv b
mod forall {b}. NameEnv [b] -> NameEnv b
name forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall a.
Typeable a =>
([Word8] -> a) -> ModGuts -> CoreM (ModuleEnv [a], NameEnv [a])
getAnnotations [Word8] -> a
deserialize ModGuts
guts
where
mod :: ModuleEnv [b] -> ModuleEnv b
mod = forall a b. (Module -> a -> Maybe b) -> ModuleEnv a -> ModuleEnv b
mapMaybeModuleEnv (forall a b. a -> b -> a
const forall a. [a] -> Maybe a
listToMaybe)
name :: NameEnv [b] -> NameEnv b
name = forall a b. (a -> Maybe b) -> NameEnv a -> NameEnv b
mapMaybeNameEnv forall a. [a] -> Maybe a
listToMaybe
msg :: MessageClass -> SDoc -> CoreM ()
msg :: MessageClass -> SDoc -> CoreM ()
msg MessageClass
msg_class SDoc
doc = do
Logger
logger <- forall (m :: * -> *). HasLogger m => m Logger
getLogger
SrcSpan
loc <- CoreM SrcSpan
getSrcSpanM
NamePprCtx
name_ppr_ctx <- CoreM NamePprCtx
getNamePprCtx
let sty :: PprStyle
sty = case MessageClass
msg_class of
MCDiagnostic Severity
_ DiagnosticReason
_ Maybe DiagnosticCode
_ -> PprStyle
err_sty
MessageClass
MCDump -> PprStyle
dump_sty
MessageClass
_ -> PprStyle
user_sty
err_sty :: PprStyle
err_sty = NamePprCtx -> PprStyle
mkErrStyle NamePprCtx
name_ppr_ctx
user_sty :: PprStyle
user_sty = NamePprCtx -> Depth -> PprStyle
mkUserStyle NamePprCtx
name_ppr_ctx Depth
AllTheWay
dump_sty :: PprStyle
dump_sty = NamePprCtx -> PprStyle
mkDumpStyle NamePprCtx
name_ppr_ctx
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ Logger -> MessageClass -> SrcSpan -> SDoc -> IO ()
logMsg Logger
logger MessageClass
msg_class SrcSpan
loc (PprStyle -> SDoc -> SDoc
withPprStyle PprStyle
sty SDoc
doc)
putMsgS :: String -> CoreM ()
putMsgS :: String -> CoreM ()
putMsgS = SDoc -> CoreM ()
putMsg forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall doc. IsLine doc => String -> doc
text
putMsg :: SDoc -> CoreM ()
putMsg :: SDoc -> CoreM ()
putMsg = MessageClass -> SDoc -> CoreM ()
msg MessageClass
MCInfo
errorMsg :: SDoc -> CoreM ()
errorMsg :: SDoc -> CoreM ()
errorMsg SDoc
doc = MessageClass -> SDoc -> CoreM ()
msg MessageClass
errorDiagnostic SDoc
doc
fatalErrorMsgS :: String -> CoreM ()
fatalErrorMsgS :: String -> CoreM ()
fatalErrorMsgS = SDoc -> CoreM ()
fatalErrorMsg forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall doc. IsLine doc => String -> doc
text
fatalErrorMsg :: SDoc -> CoreM ()
fatalErrorMsg :: SDoc -> CoreM ()
fatalErrorMsg = MessageClass -> SDoc -> CoreM ()
msg MessageClass
MCFatal
debugTraceMsgS :: String -> CoreM ()
debugTraceMsgS :: String -> CoreM ()
debugTraceMsgS = SDoc -> CoreM ()
debugTraceMsg forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall doc. IsLine doc => String -> doc
text
debugTraceMsg :: SDoc -> CoreM ()
debugTraceMsg :: SDoc -> CoreM ()
debugTraceMsg = MessageClass -> SDoc -> CoreM ()
msg MessageClass
MCDump