[commit: ghc] master: Change a few throwGhcException uses to throwGhcExceptionIO (a0c3263)
Ian Lynagh
igloo at earth.li
Thu Jan 31 01:29:59 CET 2013
Repository : ssh://darcs.haskell.org//srv/darcs/ghc
On branch : master
http://hackage.haskell.org/trac/ghc/changeset/a0c3263435a2d30c23c026dca6dd8b347ea5d263
>---------------------------------------------------------------
commit a0c3263435a2d30c23c026dca6dd8b347ea5d263
Author: Ian Lynagh <ian at well-typed.com>
Date: Wed Jan 30 14:17:38 2013 +0000
Change a few throwGhcException uses to throwGhcExceptionIO
>---------------------------------------------------------------
compiler/main/GHC.hs | 4 ++--
compiler/main/StaticFlags.hs | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/compiler/main/GHC.hs b/compiler/main/GHC.hs
index 35db120..5db2de4 100644
--- a/compiler/main/GHC.hs
+++ b/compiler/main/GHC.hs
@@ -618,7 +618,7 @@ guessTarget str Nothing
then return (target (TargetModule (mkModuleName file)))
else do
dflags <- getDynFlags
- throwGhcException
+ liftIO $ throwGhcExceptionIO
(ProgramError (showSDoc dflags $
text "target" <+> quotes (text file) <+>
text "is not a module name or a source file"))
@@ -1323,7 +1323,7 @@ findModule mod_name maybe_pkg = withSession $ \hsc_env -> do
err -> noModError dflags noSrcSpan mod_name err
modNotLoadedError :: DynFlags -> Module -> ModLocation -> IO a
-modNotLoadedError dflags m loc = throwGhcException $ CmdLineError $ showSDoc dflags $
+modNotLoadedError dflags m loc = throwGhcExceptionIO $ CmdLineError $ showSDoc dflags $
text "module is not loaded:" <+>
quotes (ppr (moduleName m)) <+>
parens (text (expectJust "modNotLoadedError" (ml_hs_file loc)))
diff --git a/compiler/main/StaticFlags.hs b/compiler/main/StaticFlags.hs
index 7684564..c982d14 100644
--- a/compiler/main/StaticFlags.hs
+++ b/compiler/main/StaticFlags.hs
@@ -89,10 +89,10 @@ parseStaticFlagsFull :: [Flag IO] -> [Located String]
-> IO ([Located String], [Located String])
parseStaticFlagsFull flagsAvailable args = do
ready <- readIORef v_opt_C_ready
- when ready $ throwGhcException (ProgramError "Too late for parseStaticFlags: call it before newSession")
+ when ready $ throwGhcExceptionIO (ProgramError "Too late for parseStaticFlags: call it before newSession")
(leftover, errs, warns) <- processArgs flagsAvailable args
- when (not (null errs)) $ throwGhcException $ errorsToGhcException errs
+ when (not (null errs)) $ throwGhcExceptionIO $ errorsToGhcException errs
-- see sanity code in staticOpts
writeIORef v_opt_C_ready True
More information about the ghc-commits
mailing list