X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Fmain%2FMain.hs;h=d81b9fe939df218f8d35ee3cd3bf4b2e6b9066d8;hb=47eef4b5780f0a5b5a37847097842daebd0f9285;hp=6ad4b8bc2cce942988e05d83bb957d1ad315b195;hpb=909442c800787b2d99f755139341df7bbe153974;p=ghc-hetmet.git diff --git a/ghc/compiler/main/Main.hs b/ghc/compiler/main/Main.hs index 6ad4b8b..d81b9fe 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.17 2000/11/03 10:42:39 simonmar Exp $ -- -- GHC Driver program -- @@ -55,6 +55,7 @@ import Maybe ----------------------------------------------------------------------------- -- ToDo: +-- -nohi doesn't work -- new mkdependHS doesn't support all the options that the old one did (-X et al.) -- time commands when run with -v -- split marker @@ -164,10 +165,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,13 +195,14 @@ 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 ] + mapM unknownFlagErr [ f | f@('-':_) <- srcs ] -- get the -v flag verb <- readIORef v_Verbose @@ -242,8 +241,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