From: sewardj Date: Mon, 20 Nov 2000 16:37:42 +0000 (+0000) Subject: [project @ 2000-11-20 16:37:42 by sewardj] X-Git-Tag: Approximately_9120_patches~3299 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=8dc03e6adb52b79e795483a53ba5a264f48b8a45;p=ghc-hetmet.git [project @ 2000-11-20 16:37:42 by sewardj] Fix to -cpp not working? --- diff --git a/ghc/compiler/main/Main.hs b/ghc/compiler/main/Main.hs index 5e61fdb..46aec68 100644 --- a/ghc/compiler/main/Main.hs +++ b/ghc/compiler/main/Main.hs @@ -1,6 +1,6 @@ {-# OPTIONS -W -fno-warn-incomplete-patterns #-} ----------------------------------------------------------------------------- --- $Id: Main.hs,v 1.27 2000/11/20 16:28:29 simonmar Exp $ +-- $Id: Main.hs,v 1.28 2000/11/20 16:37:42 sewardj Exp $ -- -- GHC Driver program -- @@ -213,6 +213,12 @@ main = -- complain about any unknown flags mapM unknownFlagErr [ f | f@('-':_) <- srcs ] + -- save the flag state, because this could be modified by OPTIONS + -- pragmas during the compilation, and we'll need to restore it + -- before starting the next compilation. + saved_driver_state <- readIORef v_Driver_state + writeIORef v_InitDriverState saved_driver_state + -- get the -v flag verb <- readIORef v_Verbose @@ -247,12 +253,6 @@ main = if null srcs then throwDyn (UsageError "no input files") else do - -- save the flag state, because this could be modified by OPTIONS - -- pragmas during the compilation, and we'll need to restore it - -- before starting the next compilation. - saved_driver_state <- readIORef v_Driver_state - writeIORef v_InitDriverState saved_driver_state - let compileFile (src, phases) = do writeIORef v_Driver_state saved_driver_state writeIORef v_DynFlags init_dyn_flags