projects
/
ghc-hetmet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
ed2e46c
)
Fix warnings in Main
author
Ian Lynagh
<igloo@earth.li>
Sat, 14 Jun 2008 19:41:20 +0000
(19:41 +0000)
committer
Ian Lynagh
<igloo@earth.li>
Sat, 14 Jun 2008 19:41:20 +0000
(19:41 +0000)
compiler/main/Main.hs
patch
|
blob
|
history
diff --git
a/compiler/main/Main.hs
b/compiler/main/Main.hs
index
abf674f
..
a42a678
100644
(file)
--- a/
compiler/main/Main.hs
+++ b/
compiler/main/Main.hs
@@
-129,21
+129,21
@@
main =
-- The rest of the arguments are "dynamic"
-- Leftover ones are presumably files
-- The rest of the arguments are "dynamic"
-- Leftover ones are presumably files
- (dflags, fileish_args, dynamicFlagWarnings) <- GHC.parseDynamicFlags dflags1 argv3
+ (dflags2, fileish_args, dynamicFlagWarnings) <- GHC.parseDynamicFlags dflags1 argv3
let flagWarnings = staticFlagWarnings
++ modeFlagWarnings
++ dynamicFlagWarnings
let flagWarnings = staticFlagWarnings
++ modeFlagWarnings
++ dynamicFlagWarnings
- handleFlagWarnings dflags flagWarnings
+ handleFlagWarnings dflags2 flagWarnings
-- make sure we clean up after ourselves
-- make sure we clean up after ourselves
- GHC.defaultCleanupHandler dflags $ do
+ GHC.defaultCleanupHandler dflags2 $ do
- showBanner cli_mode dflags
+ showBanner cli_mode dflags2
-- we've finished manipulating the DynFlags, update the session
-- we've finished manipulating the DynFlags, update the session
- GHC.setSessionDynFlags session dflags
- dflags <- GHC.getSessionDynFlags session
+ GHC.setSessionDynFlags session dflags2
+ dflags3 <- GHC.getSessionDynFlags session
hsc_env <- GHC.sessionHscEnv session
let
hsc_env <- GHC.sessionHscEnv session
let
@@
-158,32
+158,32
@@
main =
mapM_ (consIORef v_Ld_inputs) (reverse objs)
---------------- Display configuration -----------
mapM_ (consIORef v_Ld_inputs) (reverse objs)
---------------- Display configuration -----------
- when (verbosity dflags >= 4) $
- dumpPackages dflags
+ when (verbosity dflags3 >= 4) $
+ dumpPackages dflags3
- when (verbosity dflags >= 3) $ do
+ when (verbosity dflags3 >= 3) $ do
hPutStrLn stderr ("Hsc static flags: " ++ unwords staticFlags)
---------------- Final sanity checking -----------
hPutStrLn stderr ("Hsc static flags: " ++ unwords staticFlags)
---------------- Final sanity checking -----------
- checkOptions cli_mode dflags srcs objs
+ checkOptions cli_mode dflags3 srcs objs
---------------- Do the business -----------
let alreadyHandled = panic (show cli_mode ++
" should already have been handled")
case cli_mode of
---------------- Do the business -----------
let alreadyHandled = panic (show cli_mode ++
" should already have been handled")
case cli_mode of
- ShowUsage -> showGhcUsage dflags cli_mode
- PrintLibdir -> putStrLn (topDir dflags)
+ ShowUsage -> showGhcUsage dflags3 cli_mode
+ PrintLibdir -> putStrLn (topDir dflags3)
ShowSupportedLanguages -> alreadyHandled
ShowVersion -> alreadyHandled
ShowNumVersion -> alreadyHandled
ShowSupportedLanguages -> alreadyHandled
ShowVersion -> alreadyHandled
ShowNumVersion -> alreadyHandled
- ShowInterface f -> doShowIface dflags f
+ ShowInterface f -> doShowIface dflags3 f
DoMake -> doMake session srcs
DoMkDependHS -> doMkDependHS session (map fst srcs)
StopBefore p -> oneShot hsc_env p srcs
DoInteractive -> interactiveUI session srcs Nothing
DoEval exprs -> interactiveUI session srcs $ Just $ reverse exprs
DoMake -> doMake session srcs
DoMkDependHS -> doMkDependHS session (map fst srcs)
StopBefore p -> oneShot hsc_env p srcs
DoInteractive -> interactiveUI session srcs Nothing
DoEval exprs -> interactiveUI session srcs $ Just $ reverse exprs
- dumpFinalStats dflags
+ dumpFinalStats dflags3
exitWith ExitSuccess
#ifndef GHCI
exitWith ExitSuccess
#ifndef GHCI
@@
-362,11
+362,11
@@
isCompManagerMode _ = False
parseModeFlags :: [String] -> IO (CmdLineMode, [String], [String])
parseModeFlags args = do
parseModeFlags :: [String] -> IO (CmdLineMode, [String], [String])
parseModeFlags args = do
- let ((leftover, errs, warns), (mode, _, flags)) =
+ let ((leftover, errs, warns), (mode, _, flags')) =
runCmdLine (processArgs mode_flags args) (StopBefore StopLn, "", [])
when (not (null errs)) $ do
throwDyn (UsageError (unlines errs))
runCmdLine (processArgs mode_flags args) (StopBefore StopLn, "", [])
when (not (null errs)) $ do
throwDyn (UsageError (unlines errs))
- return (mode, flags ++ leftover, warns)
+ return (mode, flags' ++ leftover, warns)
type ModeM = CmdLineP (CmdLineMode, String, [String])
-- mode flags sometimes give rise to new DynFlags (eg. -C, see below)
type ModeM = CmdLineP (CmdLineMode, String, [String])
-- mode flags sometimes give rise to new DynFlags (eg. -C, see below)
@@
-430,16
+430,16
@@
updateDoEval expr _ = DoEval [expr]
updateMode :: (CmdLineMode -> CmdLineMode) -> String -> ModeM ()
updateMode f flag = do
updateMode :: (CmdLineMode -> CmdLineMode) -> String -> ModeM ()
updateMode f flag = do
- (old_mode, old_flag, flags) <- getCmdLineState
+ (old_mode, old_flag, flags') <- getCmdLineState
if notNull old_flag && flag /= old_flag
then throwDyn (UsageError
("cannot use `" ++ old_flag ++ "' with `" ++ flag ++ "'"))
if notNull old_flag && flag /= old_flag
then throwDyn (UsageError
("cannot use `" ++ old_flag ++ "' with `" ++ flag ++ "'"))
- else putCmdLineState (f old_mode, flag, flags)
+ else putCmdLineState (f old_mode, flag, flags')
addFlag :: String -> ModeM ()
addFlag s = do
addFlag :: String -> ModeM ()
addFlag s = do
- (m, f, flags) <- getCmdLineState
- putCmdLineState (m, f, s:flags)
+ (m, f, flags') <- getCmdLineState
+ putCmdLineState (m, f, s:flags')
-- ----------------------------------------------------------------------------
-- ----------------------------------------------------------------------------