[project @ 2002-03-04 17:01:26 by simonmar]
[ghc-hetmet.git] / ghc / compiler / main / Main.hs
index 43b104f..cc7e80f 100644 (file)
@@ -1,7 +1,7 @@
 {-# OPTIONS -fno-warn-incomplete-patterns -optc-DNON_POSIX_SOURCE #-}
 
 -----------------------------------------------------------------------------
--- $Id: Main.hs,v 1.94 2002/01/04 16:02:04 simonmar Exp $
+-- $Id: Main.hs,v 1.96 2002/03/04 17:01:30 simonmar Exp $
 --
 -- GHC Driver program
 --
@@ -42,11 +42,11 @@ import DriverFlags  ( buildStaticHscOpts,
                          dynamic_flags, processArgs, static_flags)
 
 import DriverMkDepend  ( beginMkDependHS, endMkDependHS )
-import DriverPhases    ( Phase(HsPp, Hsc, HCc), haskellish_src_file, objish_file )
+import DriverPhases    ( Phase(HsPp, Hsc), haskellish_src_file, objish_file )
 
 import DriverUtil      ( add, handle, handleDyn, later, splitFilename,
                          unknownFlagErr, getFileSuffix )
-import CmdLineOpts     ( dynFlag, defaultDynFlags, restoreDynFlags,
+import CmdLineOpts     ( dynFlag, restoreDynFlags,
                          saveDynFlags, setDynFlags, getDynFlags, dynFlag,
                          DynFlags(..), HscLang(..), v_Static_hsc_opts
                        )
@@ -107,7 +107,10 @@ main =
           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)))
+               AsyncException StackOverflow ->
+                       hPutStrLn stderr "stack overflow: use +RTS -K<size> \ 
+                                        \to increase it"
+               _other ->  hPutStr stderr (show (Panic (show exception)))
           exitWith (ExitFailure 1)
          ) $ do