From: sof Date: Fri, 3 Aug 2001 20:40:43 +0000 (+0000) Subject: [project @ 2001-08-03 20:40:43 by sof] X-Git-Tag: Approximately_9120_patches~1364 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=e8964a486b2d0915617116eedf8b34670d443fbf;p=ghc-hetmet.git [project @ 2001-08-03 20:40:43 by sof] - have the toplevel exception handler propagate ExitExceptions, don't flag them as panics. i.e., when the dynamic exception handler catches a PhaseFailed{}, it throws an ExitException. The outer/topmost handler catches this (on a Win32 box, but not my other (Linux) box for some reason...), and maps it to a panic, which is not what you want. - introduced the old 'Compilation had errors' message in case of a PhaseFailed{}; feel free to nuke that one (again). --- diff --git a/ghc/compiler/main/Main.hs b/ghc/compiler/main/Main.hs index 984245f..930735e 100644 --- a/ghc/compiler/main/Main.hs +++ b/ghc/compiler/main/Main.hs @@ -1,6 +1,6 @@ {-# OPTIONS -fno-warn-incomplete-patterns #-} ----------------------------------------------------------------------------- --- $Id: Main.hs,v 1.81 2001/07/11 19:48:07 sof Exp $ +-- $Id: Main.hs,v 1.82 2001/08/03 20:40:43 sof Exp $ -- -- GHC Driver program -- @@ -114,14 +114,18 @@ main = handle (\exception -> do case exception of -- an IO exception probably isn't our fault, so don't panic - IOException _ -> hPutStr stderr (show exception) - _other -> hPutStr stderr (show (Panic (show exception))) + IOException _ -> hPutStr stderr (show exception) + -- let exit exceptions bubble all the way out. + ExitException e -> exitWith e + _other -> hPutStr stderr (show (Panic (show exception))) exitWith (ExitFailure 1) ) $ do -- all error messages are propagated as exceptions handleDyn (\dyn -> case dyn of - PhaseFailed _phase code -> exitWith code + PhaseFailed _phase code -> do + hPutStr stderr "\nCompilation had errors\n" + exitWith code Interrupted -> exitWith (ExitFailure 1) _ -> do hPutStrLn stderr (show (dyn :: GhcException)) exitWith (ExitFailure 1)