[commit: ghc] master: Use throwGhcExceptionIO rather than throwGhcException in main/DriverPipeline.hs (2fcb295)

Ian Lynagh igloo at earth.li
Thu Jan 31 01:29:52 CET 2013


Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/2fcb295adbe3c3f260395bc3412b55dc277e4420

>---------------------------------------------------------------

commit 2fcb295adbe3c3f260395bc3412b55dc277e4420
Author: Ian Lynagh <ian at well-typed.com>
Date:   Wed Jan 30 13:35:47 2013 +0000

    Use throwGhcExceptionIO rather than throwGhcException in main/DriverPipeline.hs

>---------------------------------------------------------------

 compiler/main/DriverPipeline.hs |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/compiler/main/DriverPipeline.hs b/compiler/main/DriverPipeline.hs
index 81d0bc0..367e109 100644
--- a/compiler/main/DriverPipeline.hs
+++ b/compiler/main/DriverPipeline.hs
@@ -430,7 +430,7 @@ compileFile :: HscEnv -> Phase -> (FilePath, Maybe Phase) -> IO FilePath
 compileFile hsc_env stop_phase (src, mb_phase) = do
    exists <- doesFileExist src
    when (not exists) $
-        throwGhcException (CmdLineError ("does not exist: " ++ src))
+        throwGhcExceptionIO (CmdLineError ("does not exist: " ++ src))
 
    let
         dflags = hsc_dflags hsc_env
@@ -542,7 +542,7 @@ runPipeline stop_phase hsc_env0 (input_fn, mb_phase)
 
          let happensBefore' = happensBefore dflags
          when (not (start_phase `happensBefore'` stop_phase)) $
-               throwGhcException (UsageError
+               throwGhcExceptionIO (UsageError
                            ("cannot compile this file to desired target: "
                               ++ input_fn))
 
@@ -1895,8 +1895,8 @@ linkBinary dflags o_files dep_packages = do
 
     -- parallel only: move binary to another dir -- HWL
     success <- runPhase_MoveBinary dflags output_fn
-    if success then return ()
-               else throwGhcException (InstallationError ("cannot move binary"))
+    unless success $
+        throwGhcExceptionIO (InstallationError ("cannot move binary"))
 
 
 exeFileName :: DynFlags -> FilePath





More information about the ghc-commits mailing list