{-# OPTIONS -#include "hschooks.h" #-}
-----------------------------------------------------------------------------
--- $Id: DriverFlags.hs,v 1.38 2001/01/08 12:31:34 rrt Exp $
+-- $Id: DriverFlags.hs,v 1.39 2001/01/12 11:04:45 simonmar Exp $
--
-- Driver flags
--
import DriverUtil
import TmpFiles ( v_TmpDir )
import CmdLineOpts
-import TmpFiles ( newTempName )
import Config
import Util
import Panic
import Exception
import IOExts
-import Directory ( removeFile )
import IO
import Maybe
import Monad
then dfs{ verbosity = n }
else dfs)
-setVerbosity "" = updDynFlags (\dfs -> dfs{ verbosity = 2 })
+setVerbosity "" = updDynFlags (\dfs -> dfs{ verbosity = 3 })
setVerbosity n
| all isDigit n = updDynFlags (\dfs -> dfs{ verbosity = read n })
| otherwise = throwDyn (OtherError "can't parse verbosity flag (-v<n>)")
_ -> error "unknown opt level"
-- ToDo: -Ofile
- let stg_opts = [ "-flet-no-escape" ]
- -- let-no-escape always on for now
-
-- take into account -fno-* flags by removing the equivalent -f*
-- flag from our list.
anti_flags <- getStaticOpts v_Anti_opt_C
- let basic_opts = opt_C_ ++ optimisation_opts ++ stg_opts
+ let basic_opts = opt_C_ ++ optimisation_opts
filtered_opts = filter (`notElem` anti_flags) basic_opts
static <- (do s <- readIORef v_Static; if s then return "-static"
runSomething phase_name cmd
= do
verb <- dynFlag verbosity
- when (verb >= 2) $ putStrLn ("*** " ++ phase_name)
- when (verb >= 3) $ putStrLn cmd
- hFlush stdout
+ when (verb >= 2) $ hPutStrLn stderr ("*** " ++ phase_name)
+ when (verb >= 3) $ hPutStrLn stderr cmd
+ hFlush stderr
-- test for -n flag
n <- readIORef v_Dry_run
if exit_code /= ExitSuccess
then throwDyn (PhaseFailed phase_name exit_code)
- else do when (verb >= 3) (putStr "\n")
+ else do when (verb >= 3) (hPutStr stderr "\n")
return ()