From 099c27165f511374eb22c39c2b75d5f8de8ee3a5 Mon Sep 17 00:00:00 2001 From: sof Date: Wed, 5 Dec 2001 00:08:27 +0000 Subject: [PATCH] [project @ 2001-12-05 00:08:26 by sof] - 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 | 5 ++++- ghc/compiler/main/DriverPipeline.hs | 6 ++++++ ghc/compiler/main/DriverState.hs | 7 +++++-- ghc/compiler/main/Main.hs | 4 ++-- 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/ghc/compiler/main/DriverFlags.hs b/ghc/compiler/main/DriverFlags.hs index 069ddb7..9d9d335 100644 --- a/ghc/compiler/main/DriverFlags.hs +++ b/ghc/compiler/main/DriverFlags.hs @@ -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 diff --git a/ghc/compiler/main/DriverPipeline.hs b/ghc/compiler/main/DriverPipeline.hs index 44dbe50..c43381c 100644 --- a/ghc/compiler/main/DriverPipeline.hs +++ b/ghc/compiler/main/DriverPipeline.hs @@ -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 <- diff --git a/ghc/compiler/main/DriverState.hs b/ghc/compiler/main/DriverState.hs index 2a8c09e..cc56e9e 100644 --- a/ghc/compiler/main/DriverState.hs +++ b/ghc/compiler/main/DriverState.hs @@ -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) diff --git a/ghc/compiler/main/Main.hs b/ghc/compiler/main/Main.hs index fb1556c..f85040b 100644 --- a/ghc/compiler/main/Main.hs +++ b/ghc/compiler/main/Main.hs @@ -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) -- 1.7.10.4