[project @ 2001-12-05 00:08:26 by sof]
authorsof <unknown>
Wed, 5 Dec 2001 00:08:27 +0000 (00:08 +0000)
committersof <unknown>
Wed, 5 Dec 2001 00:08:27 +0000 (00:08 +0000)
- new option, -keep-ilx-file, for stashing away ILX input.
- restrict ILX-specific code/defs to only be visible iff ILX is #defined.

ghc/compiler/main/DriverFlags.hs
ghc/compiler/main/DriverPipeline.hs
ghc/compiler/main/DriverState.hs
ghc/compiler/main/Main.hs

index 069ddb7..9d9d335 100644 (file)
@@ -1,7 +1,7 @@
 {-# OPTIONS -#include "hschooks.h" #-}
 
 -----------------------------------------------------------------------------
--- $Id: DriverFlags.hs,v 1.79 2001/12/03 14:49:24 sebc Exp $
+-- $Id: DriverFlags.hs,v 1.80 2001/12/05 00:08:26 sof Exp $
 --
 -- Driver flags
 --
@@ -221,7 +221,10 @@ static_flags =
   ,  ( "keep-hc-file"   , AnySuffix (\_ -> writeIORef v_Keep_hc_files True) )
   ,  ( "keep-s-file"    , AnySuffix (\_ -> writeIORef v_Keep_s_files  True) )
   ,  ( "keep-raw-s-file", AnySuffix (\_ -> writeIORef v_Keep_raw_s_files  True) )
+#ifdef ILX
   ,  ( "keep-il-file"   , AnySuffix (\_ -> writeIORef v_Keep_il_files True) )
+  ,  ( "keep-ilx-file"  , AnySuffix (\_ -> writeIORef v_Keep_ilx_files True) )
+#endif
   ,  ( "keep-tmp-files" , AnySuffix (\_ -> writeIORef v_Keep_tmp_files True) )
 
   ,  ( "split-objs"    , NoArg (if can_split
index 44dbe50..c43381c 100644 (file)
@@ -135,7 +135,10 @@ genPipeline todo stop_flag persistent_output lang (filename,suffix)
    split      <- readIORef v_Split_object_files
    mangle     <- readIORef v_Do_asm_mangling
    keep_hc    <- readIORef v_Keep_hc_files
+#ifdef ILX
    keep_il    <- readIORef v_Keep_il_files
+   keep_ilx   <- readIORef v_Keep_ilx_files
+#endif
    keep_raw_s <- readIORef v_Keep_raw_s_files
    keep_s     <- readIORef v_Keep_s_files
    osuf       <- readIORef v_Object_suf
@@ -237,6 +240,7 @@ genPipeline todo stop_flag persistent_output lang (filename,suffix)
                             As     | keep_s     -> Persistent
                             HCc    | keep_hc    -> Persistent
 #ifdef ILX
+                            Ilx2Il | keep_ilx   -> Persistent
                             Ilasm  | keep_il    -> Persistent
 #endif
                             _other              -> Temporary
@@ -1072,7 +1076,9 @@ compile ghci_mode summary source_unchanged have_object
        (basename, _) = splitFilename input_fn
        
    keep_hc <- readIORef v_Keep_hc_files
+#ifdef ILX
    keep_il <- readIORef v_Keep_il_files
+#endif
    keep_s  <- readIORef v_Keep_s_files
 
    output_fn <- 
index 2a8c09e..cc56e9e 100644 (file)
@@ -1,5 +1,5 @@
 -----------------------------------------------------------------------------
--- $Id: DriverState.hs,v 1.61 2001/10/26 00:53:27 sof Exp $
+-- $Id: DriverState.hs,v 1.62 2001/12/05 00:08:27 sof Exp $
 --
 -- Settings for the driver
 --
@@ -68,10 +68,13 @@ v_Hs_source_cpp_opts = global
 -- Keep output from intermediate phases
 GLOBAL_VAR(v_Keep_hi_diffs,            False,          Bool)
 GLOBAL_VAR(v_Keep_hc_files,            False,          Bool)
-GLOBAL_VAR(v_Keep_il_files,            False,          Bool)
 GLOBAL_VAR(v_Keep_s_files,             False,          Bool)
 GLOBAL_VAR(v_Keep_raw_s_files,         False,          Bool)
 GLOBAL_VAR(v_Keep_tmp_files,           False,          Bool)
+#ifdef ILX
+GLOBAL_VAR(v_Keep_il_files,            False,          Bool)
+GLOBAL_VAR(v_Keep_ilx_files,           False,          Bool)
+#endif
 
 -- Misc
 GLOBAL_VAR(v_Scale_sizes_by,           1.0,            Double)
index fb1556c..f85040b 100644 (file)
@@ -1,7 +1,7 @@
 {-# OPTIONS -fno-warn-incomplete-patterns -optc-DNON_POSIX_SOURCE #-}
 
 -----------------------------------------------------------------------------
--- $Id: Main.hs,v 1.91 2001/11/03 01:30:42 sof Exp $
+-- $Id: Main.hs,v 1.92 2001/12/05 00:08:27 sof Exp $
 --
 -- GHC Driver program
 --
@@ -125,7 +125,7 @@ main =
   handleDyn (\dyn -> do
                hFlush stdout
                case dyn of
-                    PhaseFailed _phase code -> exitWith code
+                    PhaseFailed _ code -> exitWith code
                     Interrupted -> exitWith (ExitFailure 1)
                     _ -> do hPutStrLn stderr (show (dyn :: GhcException))
                             exitWith (ExitFailure 1)