X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fmain%2FDriverPipeline.hs;h=59f072197c8b47570f727bd6d75da01c8819cc27;hb=5ddee764beb312933256096d03df7c3ec47ac452;hp=690328d8070021310feafa4cd573fae9b31c7d65;hpb=0a4c03a87095fa6440fa89369daa8f3ea727cf7f;p=ghc-hetmet.git diff --git a/compiler/main/DriverPipeline.hs b/compiler/main/DriverPipeline.hs index 690328d..59f0721 100644 --- a/compiler/main/DriverPipeline.hs +++ b/compiler/main/DriverPipeline.hs @@ -50,17 +50,18 @@ import ParserCoreUtils ( getCoreModuleName ) import SrcLoc ( unLoc ) import SrcLoc ( Located(..) ) -import EXCEPTION -import DATA_IOREF ( readIORef, writeIORef, IORef ) -import GLAEXTS ( Int(..) ) - -import Directory -import System -import IO -import Monad +import Control.Exception as Exception +import Data.IORef ( readIORef, writeIORef, IORef ) +import GHC.Exts ( Int(..) ) +import System.Directory +import System.IO +import SYSTEM_IO_ERROR as IO +import Control.Monad import Data.List ( isSuffixOf ) -import Maybe - +import Data.Maybe +import System.Exit +import System.Cmd +import System.Environment -- --------------------------------------------------------------------------- -- Pre-process @@ -415,9 +416,7 @@ runPipeline stop_phase dflags (input_fn, mb_phase) output maybe_loc let (basename, suffix) = splitFilename input_fn -- If we were given a -x flag, then use that phase to start from - start_phase - | Just x_phase <- mb_phase = x_phase - | otherwise = startPhase suffix + start_phase = fromMaybe (startPhase suffix) mb_phase -- We want to catch cases of "you can't get there from here" before -- we start the pipeline, because otherwise it will just run off the @@ -881,6 +880,10 @@ runPhase cc_phase stop dflags basename suff input_fn get_output_fn maybe_loc ++ split_opt ++ include_paths ++ pkg_extra_cc_opts +#ifdef HAVE_GCC_HAS_WRAPV + -- We need consistent integer overflow (trac #952) + ++ ["-fwrapv"] +#endif )) return (next_phase, dflags, maybe_loc, output_fn) @@ -1133,7 +1136,7 @@ checkProcessArgsResult flags filename getHCFilePackages :: FilePath -> IO [PackageId] getHCFilePackages filename = - EXCEPTION.bracket (openFile filename ReadMode) hClose $ \h -> do + Exception.bracket (openFile filename ReadMode) hClose $ \h -> do l <- hGetLine h case l of '/':'*':' ':'G':'H':'C':'_':'P':'A':'C':'K':'A':'G':'E':'S':rest ->