X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Fmain%2FDriverPipeline.hs;h=d81b6af2e26efbf80e95ef2bd17a6a7e9c86a5e6;hb=dedafdb01a611b45b45844aaf3816a82680755fa;hp=d7bc710d793ac52dd1a111f0ab41f63e77bb7534;hpb=65494b207a56d8efdafcbe27b17f3141374fdb27;p=ghc-hetmet.git diff --git a/ghc/compiler/main/DriverPipeline.hs b/ghc/compiler/main/DriverPipeline.hs index d7bc710..d81b6af 100644 --- a/ghc/compiler/main/DriverPipeline.hs +++ b/ghc/compiler/main/DriverPipeline.hs @@ -1,5 +1,5 @@ ----------------------------------------------------------------------------- --- $Id: DriverPipeline.hs,v 1.47 2001/01/09 17:16:35 rrt Exp $ +-- $Id: DriverPipeline.hs,v 1.50 2001/02/05 17:52:49 rrt Exp $ -- -- GHC Driver -- @@ -322,7 +322,7 @@ run_phase Cpp basename suff input_fn output_fn ++ ": static flags are not allowed in {-# OPTIONS #-} pragmas:\n\t" ++ unwords unhandled_flags)) (ExitFailure 1)) - do_cpp <- readState cpp_flag + do_cpp <- dynFlag cppFlag if do_cpp then do cpp <- readIORef v_Pgm_P @@ -335,19 +335,21 @@ run_phase Cpp basename suff input_fn output_fn ++ pkg_include_dirs) verb <- getVerbFlag + (md_c_flags, _) <- machdepCCOpts runSomething "C pre-processor" (unwords - (["echo '{-# LINE 1 \"" ++ input_fn ++ "\" -}'", ">", output_fn, "&&", + (["echo '{-# LINE 1 \"" ++ input_fn ++ "\" #-}'", ">", output_fn, "&&", cpp, verb] ++ include_paths ++ hs_src_cpp_opts ++ hscpp_opts + ++ md_c_flags ++ [ "-x", "c", input_fn, ">>", output_fn ] )) else do runSomething "Ineffective C pre-processor" - ("echo '{-# LINE 1 \"" ++ input_fn ++ "\" -}' > " + ("echo '{-# LINE 1 \"" ++ input_fn ++ "\" #-}' > " ++ output_fn ++ " && cat " ++ input_fn ++ " >> " ++ output_fn) return True @@ -525,7 +527,7 @@ run_phase cc_phase _basename _suff input_fn output_fn ++ pkg_include_dirs) c_includes <- getPackageCIncludes - cmdline_includes <- readState cmdline_hc_includes -- -#include options + cmdline_includes <- dynFlag cmdlineHcIncludes -- -#include options let cc_injects | hcc = unlines (map mk_include (c_includes ++ reverse cmdline_includes)) @@ -588,7 +590,7 @@ run_phase Mangle _basename _suff input_fn output_fn mangler_opts <- getOpts opt_m machdep_opts <- if (prefixMatch "i386" cTARGETPLATFORM) - then do n_regs <- readState stolen_x86_regs + then do n_regs <- dynFlag stolen_x86_regs return [ show n_regs ] else return [] runSomething "Assembly Mangler" @@ -811,14 +813,12 @@ doMkDLL o_files = do preprocess :: FilePath -> IO FilePath preprocess filename = ASSERT(haskellish_file filename) - do init_driver_state <- readIORef v_InitDriverState - writeIORef v_Driver_state init_driver_state - + do init_dyn_flags <- readIORef v_InitDynFlags + writeIORef v_DynFlags init_dyn_flags pipeline <- genPipeline (StopBefore Hsc) ("preprocess") False defaultHscLang filename runPipeline pipeline filename False{-no linking-} False{-no -o flag-} - ----------------------------------------------------------------------------- -- Compile a single module, under the control of the compilation manager. -- @@ -858,8 +858,6 @@ data CompResult compile ghci_mode summary source_unchanged old_iface hst hit pcs = do init_dyn_flags <- readIORef v_InitDynFlags writeIORef v_DynFlags init_dyn_flags - init_driver_state <- readIORef v_InitDriverState - writeIORef v_Driver_state init_driver_state showPass init_dyn_flags (showSDoc (text "Compiling" <+> ppr (name_of_summary summary)))