diff options
author | Ian Lynagh <ian@well-typed.com> | 2013-01-30 14:17:38 +0000 |
---|---|---|
committer | Ian Lynagh <ian@well-typed.com> | 2013-01-30 17:43:45 +0000 |
commit | a0c3263435a2d30c23c026dca6dd8b347ea5d263 (patch) | |
tree | 72d3b3ab15b7bd1ff1647874531afd5f5b0317b9 | |
parent | 0a1b7cb85fac3988ae625ba8bb491de81c39bfdc (diff) | |
download | haskell-a0c3263435a2d30c23c026dca6dd8b347ea5d263.tar.gz |
Change a few throwGhcException uses to throwGhcExceptionIO
-rw-r--r-- | compiler/main/GHC.hs | 4 | ||||
-rw-r--r-- | 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 35db120849..5db2de4f41 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 76845644e0..c982d14b33 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 |