From 6cc5709b0dcb71bbf97354cb1fd6dae1c0104f5b Mon Sep 17 00:00:00 2001 From: simonmar Date: Fri, 14 Jul 2000 08:19:02 +0000 Subject: [PATCH] [project @ 2000-07-14 08:19:02 by simonmar] Add -keep-tmp-files flag, to tell the driver not to delete tmp files. Useful mainly for debugging the driver, and obsoletes the GHC folklore of using ^Z for this purpose. --- ghc/driver/Main.hs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ghc/driver/Main.hs b/ghc/driver/Main.hs index ac1e36c..6916521 100644 --- a/ghc/driver/Main.hs +++ b/ghc/driver/Main.hs @@ -161,9 +161,13 @@ instance Typeable BarfKind where -- Temporary files GLOBAL_VAR(files_to_clean, [], [String]) +GLOBAL_VAR(keep_tmp_files, False, Bool) cleanTempFiles :: IO () cleanTempFiles = do + forget_it <- readIORef keep_tmp_files + if forget_it then return () else do + fs <- readIORef files_to_clean verb <- readIORef verbose @@ -1763,6 +1767,7 @@ opts = , ( "keep-hc-file" , AnySuffix (\_ -> writeIORef keep_hc_files True) ) , ( "keep-s-file" , AnySuffix (\_ -> writeIORef keep_s_files True) ) , ( "keep-raw-s-file", AnySuffix (\_ -> writeIORef keep_raw_s_files True) ) + , ( "keep-tmp-files" , AnySuffix (\_ -> writeIORef keep_tmp_files True) ) , ( "split-objs" , NoArg (if can_split then do writeIORef split_object_files True -- 1.7.10.4