From d1c6e4f72a71256cff5d7448cd0c51e7dee4eef4 Mon Sep 17 00:00:00 2001 From: simonmar Date: Tue, 31 Oct 2000 11:13:29 +0000 Subject: [PATCH] [project @ 2000-10-31 11:13:29 by simonmar] - fix the way flags, don't complain about non-static way flags - reset the dyn flags before each compilation cycle --- ghc/compiler/main/Main.hs | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/ghc/compiler/main/Main.hs b/ghc/compiler/main/Main.hs index 6ad4b8b..3fdb0fb 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.14 2000/10/27 14:36:36 simonmar Exp $ +-- $Id: Main.hs,v 1.15 2000/10/31 11:13:29 simonmar Exp $ -- -- GHC Driver program -- @@ -164,10 +164,7 @@ main = -- find the build tag, and re-process the build-specific options more_opts <- findBuildTag - left_over <- processArgs static_flags more_opts [] - if not (null left_over) - then throwDyn (OtherError "non-static flag in way-specific options") - else do + way_non_static <- processArgs static_flags more_opts [] -- give the static flags to hsc static_opts <- buildStaticHscOpts @@ -197,10 +194,11 @@ main = flags = [] } -- the rest of the arguments are "dynamic" - srcs <- processArgs dynamic_flags (non_static ++ warn_opts) [] + srcs <- processArgs dynamic_flags (way_non_static ++ + non_static ++ warn_opts) [] -- save the "initial DynFlags" away - dyn_flags <- readIORef v_DynFlags - writeIORef v_InitDynFlags dyn_flags + init_dyn_flags <- readIORef v_DynFlags + writeIORef v_InitDynFlags init_dyn_flags -- complain about any unknown flags mapM unknownFlagErr [ f | ('-':f) <- srcs ] @@ -242,8 +240,9 @@ main = saved_driver_state <- readIORef v_Driver_state let compileFile (src, phases) = do - r <- runPipeline phases src (mode==DoLink) True writeIORef v_Driver_state saved_driver_state + writeIORef v_DynFlags init_dyn_flags + r <- runPipeline phases src (mode==DoLink) True return r o_files <- mapM compileFile src_pipelines -- 1.7.10.4