Commit 6f57245b authored by simonmar's avatar simonmar

[project @ 2002-01-04 16:02:03 by simonmar]

Some driver cleanups; in particular -fno-code should work in a more
reasonable way (it is now a "mode flag" like -C, -c, --make etc.).
parent ce26c4b7
...@@ -46,7 +46,6 @@ where ...@@ -46,7 +46,6 @@ where
import CmLink import CmLink
import CmTypes import CmTypes
import DriverPipeline import DriverPipeline
import DriverFlags ( getDynFlags )
import DriverState ( v_Output_file ) import DriverState ( v_Output_file )
import DriverPhases import DriverPhases
import DriverUtil import DriverUtil
...@@ -59,7 +58,7 @@ import HscMain ( initPersistentCompilerState ) ...@@ -59,7 +58,7 @@ import HscMain ( initPersistentCompilerState )
import HscTypes import HscTypes
import Name ( Name, NamedThing(..), nameRdrName, nameModule, import Name ( Name, NamedThing(..), nameRdrName, nameModule,
isHomePackageName ) isHomePackageName )
import RdrName ( lookupRdrEnv, emptyRdrEnv ) import RdrName ( emptyRdrEnv )
import Module import Module
import GetImports import GetImports
import UniqFM import UniqFM
...@@ -70,11 +69,12 @@ import SysTools ( cleanTempFilesExcept ) ...@@ -70,11 +69,12 @@ import SysTools ( cleanTempFilesExcept )
import Util import Util
import Outputable import Outputable
import Panic import Panic
import CmdLineOpts ( DynFlags(..) ) import CmdLineOpts ( DynFlags(..), getDynFlags )
import IOExts import IOExts
#ifdef GHCI #ifdef GHCI
import RdrName ( lookupRdrEnv )
import Id ( idType, idName ) import Id ( idType, idName )
import NameEnv import NameEnv
import Type ( tidyType ) import Type ( tidyType )
......
...@@ -26,6 +26,9 @@ module CmdLineOpts ( ...@@ -26,6 +26,9 @@ module CmdLineOpts (
dopt_StgToDo, -- DynFlags -> [StgToDo] dopt_StgToDo, -- DynFlags -> [StgToDo]
dopt_HscLang, -- DynFlags -> HscLang dopt_HscLang, -- DynFlags -> HscLang
dopt_OutName, -- DynFlags -> String dopt_OutName, -- DynFlags -> String
getOpts, -- (DynFlags -> [a]) -> IO [a]
setLang,
getVerbFlag,
-- Manipulating the DynFlags state -- Manipulating the DynFlags state
getDynFlags, -- IO DynFlags getDynFlags, -- IO DynFlags
...@@ -383,6 +386,22 @@ dopt_set dfs f = dfs{ flags = f : flags dfs } ...@@ -383,6 +386,22 @@ dopt_set dfs f = dfs{ flags = f : flags dfs }
dopt_unset :: DynFlags -> DynFlag -> DynFlags dopt_unset :: DynFlags -> DynFlag -> DynFlags
dopt_unset dfs f = dfs{ flags = filter (/= f) (flags dfs) } dopt_unset dfs f = dfs{ flags = filter (/= f) (flags dfs) }
getOpts :: (DynFlags -> [a]) -> IO [a]
-- We add to the options from the front, so we need to reverse the list
getOpts opts = dynFlag opts >>= return . reverse
-- we can only switch between HscC, HscAsmm, and HscILX with dynamic flags
-- (-fvia-C, -fasm, -filx respectively).
setLang l = updDynFlags (\ dfs -> case hscLang dfs of
HscC -> dfs{ hscLang = l }
HscAsm -> dfs{ hscLang = l }
HscILX -> dfs{ hscLang = l }
_ -> dfs)
getVerbFlag = do
verb <- dynFlag verbosity
if verb >= 3 then return "-v" else return ""
\end{code} \end{code}
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
......
{-# OPTIONS -#include "hschooks.h" #-} {-# OPTIONS -#include "hschooks.h" #-}
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
-- $Id: DriverFlags.hs,v 1.83 2001/12/20 11:19:07 simonpj Exp $ -- $Id: DriverFlags.hs,v 1.84 2002/01/04 16:02:04 simonmar Exp $
-- --
-- Driver flags -- Driver flags
-- --
...@@ -11,8 +11,7 @@ ...@@ -11,8 +11,7 @@
module DriverFlags ( module DriverFlags (
processArgs, OptKind(..), static_flags, dynamic_flags, processArgs, OptKind(..), static_flags, dynamic_flags,
getDynFlags, dynFlag, addCmdlineHCInclude,
getOpts, getVerbFlag, addCmdlineHCInclude,
buildStaticHscOpts, buildStaticHscOpts,
machdepCCOpts machdepCCOpts
) where ) where
...@@ -21,6 +20,7 @@ module DriverFlags ( ...@@ -21,6 +20,7 @@ module DriverFlags (
#include "../includes/config.h" #include "../includes/config.h"
import DriverState import DriverState
import DriverPhases
import DriverUtil import DriverUtil
import SysTools import SysTools
import CmdLineOpts import CmdLineOpts
...@@ -166,6 +166,22 @@ static_flags = ...@@ -166,6 +166,22 @@ static_flags =
------- verbosity ---------------------------------------------------- ------- verbosity ----------------------------------------------------
, ( "n" , NoArg setDryRun ) , ( "n" , NoArg setDryRun )
------- primary modes ------------------------------------------------
, ( "M" , PassFlag (setMode DoMkDependHS))
, ( "E" , PassFlag (setMode (StopBefore Hsc)))
, ( "C" , PassFlag (\f -> do setMode (StopBefore HCc) f
setLang HscC))
, ( "S" , PassFlag (setMode (StopBefore As)))
, ( "c" , PassFlag (setMode (StopBefore Ln)))
, ( "-make" , PassFlag (setMode DoMake))
, ( "-interactive" , PassFlag (setMode DoInteractive))
, ( "-mk-dll" , PassFlag (setMode DoMkDLL))
-- -fno-code says to stop after Hsc but don't generate any code.
, ( "fno-code" , PassFlag (\f -> do setMode (StopBefore HCc) f
setLang HscNothing
writeIORef v_Recomp False))
------- GHCi ------------------------------------------------------- ------- GHCi -------------------------------------------------------
, ( "ignore-dot-ghci", NoArg (writeIORef v_Read_DotGHCi False) ) , ( "ignore-dot-ghci", NoArg (writeIORef v_Read_DotGHCi False) )
, ( "read-dot-ghci" , NoArg (writeIORef v_Read_DotGHCi True) ) , ( "read-dot-ghci" , NoArg (writeIORef v_Read_DotGHCi True) )
...@@ -268,7 +284,9 @@ static_flags = ...@@ -268,7 +284,9 @@ static_flags =
------ Compiler flags ----------------------------------------------- ------ Compiler flags -----------------------------------------------
, ( "O2-for-C" , NoArg (writeIORef v_minus_o2_for_C True) ) , ( "O2-for-C" , NoArg (writeIORef v_minus_o2_for_C True) )
, ( "O" , OptPrefix (setOptLevel) ) , ( "O" , NoArg (setOptLevel 1))
, ( "Onot" , NoArg (setOptLevel 0))
, ( "O" , PrefixPred (all isDigit) (setOptLevel . read))
, ( "fno-asm-mangling" , NoArg (writeIORef v_Do_asm_mangling False) ) , ( "fno-asm-mangling" , NoArg (writeIORef v_Do_asm_mangling False) )
...@@ -397,7 +415,6 @@ dynamic_flags = [ ...@@ -397,7 +415,6 @@ dynamic_flags = [
, ( "fvia-c", NoArg (setLang HscC) ) , ( "fvia-c", NoArg (setLang HscC) )
, ( "fvia-C", NoArg (setLang HscC) ) , ( "fvia-C", NoArg (setLang HscC) )
, ( "filx", NoArg (setLang HscILX) ) , ( "filx", NoArg (setLang HscILX) )
, ( "fno-code", NoArg (setLang HscNothing) )
-- "active negatives" -- "active negatives"
, ( "fno-implicit-prelude", NoArg (setDynFlag Opt_NoImplicitPrelude) ) , ( "fno-implicit-prelude", NoArg (setDynFlag Opt_NoImplicitPrelude) )
...@@ -547,7 +564,8 @@ machdepCCOpts ...@@ -547,7 +564,8 @@ machdepCCOpts
| otherwise | otherwise
= return ( [], [] ) = return ( [], [] )
-----------------------------------------------------------------------------
-- local utils
addOpt_L a = updDynFlags (\s -> s{opt_L = a : opt_L s}) addOpt_L a = updDynFlags (\s -> s{opt_L = a : opt_L s})
addOpt_P a = updDynFlags (\s -> s{opt_P = a : opt_P s}) addOpt_P a = updDynFlags (\s -> s{opt_P = a : opt_P s})
...@@ -560,25 +578,9 @@ addOpt_I a = updDynFlags (\s -> s{opt_I = a : opt_I s}) ...@@ -560,25 +578,9 @@ addOpt_I a = updDynFlags (\s -> s{opt_I = a : opt_I s})
addOpt_i a = updDynFlags (\s -> s{opt_i = a : opt_i s}) addOpt_i a = updDynFlags (\s -> s{opt_i = a : opt_i s})
#endif #endif
addCmdlineHCInclude a = updDynFlags (\s -> s{cmdlineHcIncludes = a : cmdlineHcIncludes s})
getOpts :: (DynFlags -> [a]) -> IO [a]
-- We add to the options from the front, so we need to reverse the list
getOpts opts = dynFlag opts >>= return . reverse
-- we can only change HscC to HscAsm and vice-versa with dynamic flags
-- (-fvia-C and -fasm). We can also set the new lang to ILX, via -filx.
setLang l = updDynFlags (\ dfs -> case hscLang dfs of
HscC -> dfs{ hscLang = l }
HscAsm -> dfs{ hscLang = l }
HscILX -> dfs{ hscLang = l }
_ -> dfs)
setVerbosity "" = updDynFlags (\dfs -> dfs{ verbosity = 3 }) setVerbosity "" = updDynFlags (\dfs -> dfs{ verbosity = 3 })
setVerbosity n setVerbosity n
| all isDigit n = updDynFlags (\dfs -> dfs{ verbosity = read n }) | all isDigit n = updDynFlags (\dfs -> dfs{ verbosity = read n })
| otherwise = throwDyn (UsageError "can't parse verbosity flag (-v<n>)") | otherwise = throwDyn (UsageError "can't parse verbosity flag (-v<n>)")
getVerbFlag = do addCmdlineHCInclude a = updDynFlags (\s -> s{cmdlineHcIncludes = a : cmdlineHcIncludes s})
verb <- dynFlag verbosity
if verb >= 3 then return "-v" else return ""
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
-- $Id: DriverPhases.hs,v 1.14 2001/10/29 11:31:51 simonmar Exp $ -- $Id: DriverPhases.hs,v 1.15 2002/01/04 16:02:04 simonmar Exp $
-- --
-- GHC Driver -- GHC Driver
-- --
-- (c) Simon Marlow 2000 -- (c) The University of Glasgow 2002
-- --
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
...@@ -42,7 +42,7 @@ data Phase ...@@ -42,7 +42,7 @@ data Phase
| Unlit | Unlit
| Cpp | Cpp
| HsPp | HsPp
| Hsc -- ToDo: HscTargetLang | Hsc
| Cc | Cc
| HCc -- Haskellised C (as opposed to vanilla C) compilation | HCc -- Haskellised C (as opposed to vanilla C) compilation
| Mangle -- assembly mangling, now done by a separate script. | Mangle -- assembly mangling, now done by a separate script.
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
-- --
-- GHC Driver -- GHC Driver
-- --
-- (c) Simon Marlow 2000 -- (c) The University of Glasgow 2002
-- --
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
module DriverPipeline ( module DriverPipeline (
-- interfaces for the batch-mode driver -- interfaces for the batch-mode driver
GhcMode(..), getGhcMode, v_GhcMode,
genPipeline, runPipeline, pipeLoop, genPipeline, runPipeline, pipeLoop,
-- interfaces for the compilation manager (interpreted/batch-mode) -- interfaces for the compilation manager (interpreted/batch-mode)
...@@ -59,33 +58,6 @@ import Maybe ...@@ -59,33 +58,6 @@ import Maybe
import PackedString import PackedString
import MatchPS import MatchPS
-----------------------------------------------------------------------------
-- GHC modes of operation
modeFlag :: String -> Maybe GhcMode
modeFlag "-M" = Just $ DoMkDependHS
modeFlag "--mk-dll" = Just $ DoMkDLL
modeFlag "-E" = Just $ StopBefore Hsc
modeFlag "-C" = Just $ StopBefore HCc
modeFlag "-S" = Just $ StopBefore As
modeFlag "-c" = Just $ StopBefore Ln
modeFlag "--make" = Just $ DoMake
modeFlag "--interactive" = Just $ DoInteractive
modeFlag _ = Nothing
getGhcMode :: [String]
-> IO ( [String] -- rest of command line
, GhcMode
, String -- "GhcMode" flag
)
getGhcMode flags
= case my_partition modeFlag flags of
([] , rest) -> return (rest, DoLink, "") -- default is to do linking
([(flag,one)], rest) -> return (rest, one, flag)
(_ , _ ) ->
throwDyn (UsageError
"only one of the flags -M, -E, -C, -S, -c, --make, --interactive, --mk-dll is allowed")
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
-- genPipeline -- genPipeline
-- --
...@@ -161,29 +133,34 @@ genPipeline todo stop_flag persistent_output lang (filename,suffix) ...@@ -161,29 +133,34 @@ genPipeline todo stop_flag persistent_output lang (filename,suffix)
let let
----------- ----- ---- --- -- -- - - - ----------- ----- ---- --- -- -- - - -
pipeline pipeline = preprocess ++ compile
| todo == DoMkDependHS = [ Unlit, Cpp, HsPp, MkDependHS ]
preprocess
| haskellish = [ Unlit, Cpp, HsPp ]
| otherwise = [ ]
compile
| todo == DoMkDependHS = [ MkDependHS ]
| cish = [ Cc, As ]
| haskellish = | haskellish =
case real_lang of case real_lang of
HscC | split && mangle -> [ Unlit, Cpp, HsPp, Hsc, HCc, Mangle, HscC | split && mangle -> [ Hsc, HCc, Mangle, SplitMangle, SplitAs ]
SplitMangle, SplitAs ] | mangle -> [ Hsc, HCc, Mangle, As ]
| mangle -> [ Unlit, Cpp, HsPp, Hsc, HCc, Mangle, As ]
| split -> not_valid | split -> not_valid
| otherwise -> [ Unlit, Cpp, HsPp, Hsc, HCc, As ] | otherwise -> [ Hsc, HCc, As ]
HscAsm | split -> [ Unlit, Cpp, HsPp, Hsc, SplitMangle, SplitAs ] HscAsm | split -> [ Hsc, SplitMangle, SplitAs ]
| otherwise -> [ Unlit, Cpp, HsPp, Hsc, As ] | otherwise -> [ Hsc, As ]
HscJava | split -> not_valid HscJava | split -> not_valid
| otherwise -> error "not implemented: compiling via Java" | otherwise -> error "not implemented: compiling via Java"
#ifdef ILX #ifdef ILX
HscILX | split -> not_valid HscILX | split -> not_valid
| otherwise -> [ Unlit, Cpp, HsPp, Hsc, Ilx2Il, Ilasm ] | otherwise -> [ Hsc, Ilx2Il, Ilasm ]
#endif #endif
HscNothing -> [ Unlit, Cpp, HsPp, Hsc ] HscNothing -> [ Hsc, HCc ] -- HCc is a dummy stop phase
| cish = [ Cc, As ]
| otherwise = [ ] -- just pass this file through to the linker | otherwise = [ ] -- just pass this file through to the linker
...@@ -212,8 +189,9 @@ genPipeline todo stop_flag persistent_output lang (filename,suffix) ...@@ -212,8 +189,9 @@ genPipeline todo stop_flag persistent_output lang (filename,suffix)
when (start_phase `elem` pipeline && when (start_phase `elem` pipeline &&
(stop_phase /= Ln && stop_phase `notElem` pipeline)) (stop_phase /= Ln && stop_phase `notElem` pipeline))
(throwDyn (UsageError (throwDyn (UsageError
("flag " ++ stop_flag ("flag `" ++ stop_flag
++ " is incompatible with source file `" ++ filename ++ "'"))) ++ "' is incompatible with source file `"
++ filename ++ "'" ++ show pipeline ++ show stop_phase)))
let let
-- .o and .hc suffixes can be overriden by command-line options: -- .o and .hc suffixes can be overriden by command-line options:
myPhaseInputExt Ln | Just s <- osuf = s myPhaseInputExt Ln | Just s <- osuf = s
...@@ -635,12 +613,17 @@ run_phase cc_phase basename suff input_fn output_fn ...@@ -635,12 +613,17 @@ run_phase cc_phase basename suff input_fn output_fn
pkg_extra_cc_opts <- getPackageExtraCcOpts pkg_extra_cc_opts <- getPackageExtraCcOpts
split_objs <- readIORef v_Split_object_files split_objs <- readIORef v_Split_object_files
let split_opt | hcc && split_objs = [ "-DUSE_SPLIT_MARKERS" ]
| otherwise = [ ]
excessPrecision <- readIORef v_Excess_precision excessPrecision <- readIORef v_Excess_precision
SysTools.runCc ([ SysTools.Option "-x", SysTools.Option "c"
, SysTools.FileOption "" input_fn -- force the C compiler to interpret this file as C when
-- compiling .hc files, by adding the -x c option.
let langopt
| cc_phase == HCc = [ SysTools.Option "-x", SysTools.Option "c"]
| otherwise = [ ]
SysTools.runCc (langopt ++
[ SysTools.FileOption "" input_fn
, SysTools.Option "-o" , SysTools.Option "-o"
, SysTools.FileOption "" output_fn , SysTools.FileOption "" output_fn
] ]
...@@ -652,7 +635,6 @@ run_phase cc_phase basename suff input_fn output_fn ...@@ -652,7 +635,6 @@ run_phase cc_phase basename suff input_fn output_fn
++ [ verb, "-S", "-Wimplicit", opt_flag ] ++ [ verb, "-S", "-Wimplicit", opt_flag ]
++ [ "-D__GLASGOW_HASKELL__="++cProjectVersionInt ] ++ [ "-D__GLASGOW_HASKELL__="++cProjectVersionInt ]
++ cc_opts ++ cc_opts
++ split_opt
++ (if excessPrecision then [] else [ "-ffloat-store" ]) ++ (if excessPrecision then [] else [ "-ffloat-store" ])
++ include_paths ++ include_paths
++ pkg_extra_cc_opts ++ pkg_extra_cc_opts
......
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
-- $Id: DriverState.hs,v 1.65 2001/12/15 12:03:08 panne Exp $ -- $Id: DriverState.hs,v 1.66 2002/01/04 16:02:04 simonmar Exp $
-- --
-- Settings for the driver -- Settings for the driver
-- --
-- (c) The University of Glasgow 2000 -- (c) The University of Glasgow 2002
-- --
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
...@@ -46,7 +46,18 @@ data GhcMode ...@@ -46,7 +46,18 @@ data GhcMode
| DoLink -- [ the default ] | DoLink -- [ the default ]
deriving (Eq) deriving (Eq)
GLOBAL_VAR(v_GhcMode, error "mode not set", GhcMode) GLOBAL_VAR(v_GhcMode, DoLink, GhcMode)
GLOBAL_VAR(v_GhcModeFlag, "", String)
setMode :: GhcMode -> String -> IO ()
setMode m flag = do
old_mode <- readIORef v_GhcMode
old_flag <- readIORef v_GhcModeFlag
when (not (null (old_flag))) $
throwDyn (UsageError
("cannot use `" ++ old_flag ++ "' with `" ++ flag ++ "'"))
writeIORef v_GhcMode m
writeIORef v_GhcModeFlag flag
isCompManagerMode DoMake = True isCompManagerMode DoMake = True
isCompManagerMode DoInteractive = True isCompManagerMode DoInteractive = True
...@@ -146,13 +157,10 @@ osuf_ify f = do ...@@ -146,13 +157,10 @@ osuf_ify f = do
GLOBAL_VAR(v_OptLevel, 0, Int) GLOBAL_VAR(v_OptLevel, 0, Int)
setOptLevel :: String -> IO () setOptLevel :: Int -> IO ()
setOptLevel "" = do { writeIORef v_OptLevel 1 } setOptLevel n = do
setOptLevel "not" = writeIORef v_OptLevel 0 when (n >= 1) $ setLang HscC -- turn on -fvia-C with -O
setOptLevel [c] | isDigit c = do writeIORef v_OptLevel n
let level = ord c - ord '0'
writeIORef v_OptLevel level
setOptLevel s = unknownFlagErr ("-O"++s)
GLOBAL_VAR(v_minus_o2_for_C, False, Bool) GLOBAL_VAR(v_minus_o2_for_C, False, Bool)
GLOBAL_VAR(v_MaxSimplifierIterations, 4, Int) GLOBAL_VAR(v_MaxSimplifierIterations, 4, Int)
......
{-# OPTIONS -fno-warn-incomplete-patterns -optc-DNON_POSIX_SOURCE #-} {-# OPTIONS -fno-warn-incomplete-patterns -optc-DNON_POSIX_SOURCE #-}
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
-- $Id: Main.hs,v 1.93 2002/01/04 11:35:13 simonmar Exp $ -- $Id: Main.hs,v 1.94 2002/01/04 16:02:04 simonmar Exp $
-- --
-- GHC Driver program -- GHC Driver program
-- --
-- (c) Simon Marlow 2000 -- (c) The University of Glasgow 2002
-- --
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
...@@ -29,17 +29,16 @@ import Config ( cBooterVersion, cGhcUnregisterised, cProjectVersion ) ...@@ -29,17 +29,16 @@ import Config ( cBooterVersion, cGhcUnregisterised, cProjectVersion )
import SysTools ( getPackageConfigPath, initSysTools, cleanTempFiles ) import SysTools ( getPackageConfigPath, initSysTools, cleanTempFiles )
import Packages ( showPackages ) import Packages ( showPackages )
import DriverPipeline ( GhcMode(..), doLink, doMkDLL, genPipeline, import DriverPipeline ( doLink, doMkDLL, genPipeline, pipeLoop )
getGhcMode, pipeLoop, v_GhcMode
)
import DriverState ( buildCoreToDo, buildStgToDo, defaultHscLang, import DriverState ( buildCoreToDo, buildStgToDo, defaultHscLang,
findBuildTag, getPackageInfo, unregFlags, findBuildTag, getPackageInfo, unregFlags,
v_GhcMode, v_GhcModeFlag, GhcMode(..),
v_Cmdline_libraries, v_Keep_tmp_files, v_Ld_inputs, v_Cmdline_libraries, v_Keep_tmp_files, v_Ld_inputs,
v_OptLevel, v_Output_file, v_Output_hi, v_OptLevel, v_Output_file, v_Output_hi,
v_Package_details, v_Ways, getPackageExtraGhcOpts, v_Package_details, v_Ways, getPackageExtraGhcOpts,
readPackageConf readPackageConf
) )
import DriverFlags ( dynFlag, getDynFlags, buildStaticHscOpts, import DriverFlags ( buildStaticHscOpts,
dynamic_flags, processArgs, static_flags) dynamic_flags, processArgs, static_flags)
import DriverMkDepend ( beginMkDependHS, endMkDependHS ) import DriverMkDepend ( beginMkDependHS, endMkDependHS )
...@@ -48,10 +47,9 @@ import DriverPhases ( Phase(HsPp, Hsc, HCc), haskellish_src_file, objish_file ) ...@@ -48,10 +47,9 @@ import DriverPhases ( Phase(HsPp, Hsc, HCc), haskellish_src_file, objish_file )
import DriverUtil ( add, handle, handleDyn, later, splitFilename, import DriverUtil ( add, handle, handleDyn, later, splitFilename,
unknownFlagErr, getFileSuffix ) unknownFlagErr, getFileSuffix )
import CmdLineOpts ( dynFlag, defaultDynFlags, restoreDynFlags, import CmdLineOpts ( dynFlag, defaultDynFlags, restoreDynFlags,
saveDynFlags, setDynFlags, saveDynFlags, setDynFlags, getDynFlags, dynFlag,
DynFlags(..), HscLang(..), v_Static_hsc_opts DynFlags(..), HscLang(..), v_Static_hsc_opts
) )
import Outputable import Outputable
import Util import Util
import Panic ( GhcException(..), panic ) import Panic ( GhcException(..), panic )
...@@ -79,13 +77,6 @@ import Posix ( Handler(Catch), installHandler, sigINT, sigQUIT ) ...@@ -79,13 +77,6 @@ import Posix ( Handler(Catch), installHandler, sigINT, sigQUIT )
import Dynamic ( toDyn ) import Dynamic ( toDyn )
#endif #endif
-----------------------------------------------------------------------------
-- Changes:
-- * -fglasgow-exts NO LONGER IMPLIES -package lang!!! (-fglasgow-exts is a
-- dynamic flag whereas -package is a static flag.)
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
-- ToDo: -- ToDo:
...@@ -104,7 +95,6 @@ import Dynamic ( toDyn ) ...@@ -104,7 +95,6 @@ import Dynamic ( toDyn )
-- No more "Enter your Haskell program, end with ^D (on a line of its own):" -- No more "Enter your Haskell program, end with ^D (on a line of its own):"
-- consistency checking removed (may do this properly later) -- consistency checking removed (may do this properly later)
-- removed -noC
-- no -Ofile -- no -Ofile
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
...@@ -158,12 +148,10 @@ main = ...@@ -158,12 +148,10 @@ main =
conf_file <- getPackageConfigPath conf_file <- getPackageConfigPath
readPackageConf conf_file readPackageConf conf_file
-- find the phase to stop after (i.e. -E, -C, -c, -S flags)
(flags2, mode, stop_flag) <- getGhcMode argv'
writeIORef v_GhcMode mode
-- process all the other arguments, and get the source files -- process all the other arguments, and get the source files
non_static <- processArgs static_flags flags2 [] non_static <- processArgs static_flags argv' []