[commit: ghc] master: Small refactoring: Don't pass redundant stop_phase to runPipeline (ce9f805)

Ian Lynagh igloo at earth.li
Thu Feb 28 15:20:44 CET 2013


Repository : http://darcs.haskell.org/ghc.git/

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/ce9f8051cf028e277fc50183ce26d8432644c1ea

>---------------------------------------------------------------

commit ce9f8051cf028e277fc50183ce26d8432644c1ea
Author: Ian Lynagh <ian at well-typed.com>
Date:   Thu Feb 28 13:00:12 2013 +0000

    Small refactoring: Don't pass redundant stop_phase to runPipeline

>---------------------------------------------------------------

 compiler/main/DriverPipeline.hs | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/compiler/main/DriverPipeline.hs b/compiler/main/DriverPipeline.hs
index 3ece6e7..d6c46ee 100644
--- a/compiler/main/DriverPipeline.hs
+++ b/compiler/main/DriverPipeline.hs
@@ -548,7 +548,7 @@ runPipeline stop_phase hsc_env0 (input_fn, mb_phase)
                               ++ input_fn))
 
          debugTraceMsg dflags 4 (text "Running the pipeline")
-         r <- runPipeline' start_phase stop_phase hsc_env env input_fn
+         r <- runPipeline' start_phase hsc_env env input_fn
                            maybe_loc maybe_stub_o
 
          -- If we are compiling a Haskell module, and doing
@@ -566,21 +566,20 @@ runPipeline stop_phase hsc_env0 (input_fn, mb_phase)
                            Temporary -> Temporary
                  env' = env { output_spec = output' }
              hsc_env' <- newHscEnv dflags'
-             _ <- runPipeline' start_phase stop_phase hsc_env' env' input_fn
+             _ <- runPipeline' start_phase hsc_env' env' input_fn
                                maybe_loc maybe_stub_o
              return ()
          return r
 
 runPipeline'
   :: Phase                      -- ^ When to start
-  -> Phase                      -- ^ When to stop
   -> HscEnv                     -- ^ Compilation environment
   -> PipeEnv
   -> FilePath                   -- ^ Input filename
   -> Maybe ModLocation          -- ^ A ModLocation, if this is a Haskell module
   -> Maybe FilePath             -- ^ stub object, if we have one
   -> IO (DynFlags, FilePath)    -- ^ (final flags, output filename)
-runPipeline' start_phase stop_phase hsc_env env input_fn
+runPipeline' start_phase hsc_env env input_fn
              maybe_loc maybe_stub_o
   = do
   -- Execute the pipeline...
@@ -599,8 +598,9 @@ runPipeline' start_phase stop_phase hsc_env env input_fn
     Temporary ->
         return (dflags, output_fn)
     output ->
-        do final_fn <- getOutputFilename stop_phase output (src_basename env)
-                                         dflags stop_phase maybe_loc
+        do let stopPhase = stop_phase env
+           final_fn <- getOutputFilename stopPhase output (src_basename env)
+                                         dflags stopPhase maybe_loc
            when (final_fn /= output_fn) $ do
               let msg = ("Copying `" ++ output_fn ++"' to `" ++ final_fn ++ "'")
                   line_prag = Just ("{-# LINE 1 \"" ++ input_fn ++ "\" #-}\n")





More information about the ghc-commits mailing list