[project @ 2005-03-09 14:26:56 by simonpj]
[ghc-hetmet.git] / ghc / compiler / main / DriverPipeline.hs
index cd19d6c..1856dce 100644 (file)
@@ -6,8 +6,6 @@
 --
 -----------------------------------------------------------------------------
 
-#include "../includes/ghcconfig.h"
-
 module DriverPipeline (
 
        -- Interfaces for the batch-mode driver
@@ -93,10 +91,11 @@ compileFile mode dflags src = do
    ghc_link <- readIORef v_GhcLink     -- Set by -c or -no-link
        -- When linking, the -o argument refers to the linker's output. 
        -- otherwise, we use it as the name for the pipeline's output.
-   let maybe_o_file | isLinkMode mode && not (isNoLink ghc_link) 
-                   = Nothing   -- -o foo applies to linker
-                   | otherwise
-                   = o_file    -- -o foo applies to the file we are compiling now
+   let maybe_o_file
+        | isLinkMode mode && not (isNoLink ghc_link) = Nothing
+               -- -o foo applies to linker
+        | otherwise = o_file
+               -- -o foo applies to the file we are compiling now
 
        stop_phase = case mode of 
                        StopBefore As | split -> SplitAs
@@ -104,8 +103,8 @@ compileFile mode dflags src = do
                        other                 -> StopLn
 
    mode_flag_string <- readIORef v_GhcModeFlag
-   (_, out_file) <- runPipeline stop_phase mode_flag_string dflags True maybe_o_file
-                               src Nothing{-no ModLocation-}
+   (_, out_file) <- runPipeline stop_phase mode_flag_string dflags
+                        True maybe_o_file src Nothing{-no ModLocation-}
    return out_file
 
 
@@ -136,9 +135,6 @@ compile :: HscEnv
 
 data CompResult
    = CompOK   ModDetails               -- New details
-             (Maybe GlobalRdrEnv)      -- Lexical environment for the module
-                                       -- (Maybe because we may have loaded it from
-                                       --  its precompiled interface)
               ModIface                 -- New iface
               (Maybe Linkable) -- New code; Nothing => compilation was not reqd
                                --                      (old code is still valid)
@@ -206,13 +202,13 @@ compile hsc_env mod_summary
    case hsc_result of
       HscFail -> return CompErrs
 
-      HscNoRecomp details iface -> return (CompOK details Nothing iface Nothing)
+      HscNoRecomp details iface -> return (CompOK details iface Nothing)
 
-      HscRecomp details rdr_env iface
+      HscRecomp details iface
                stub_h_exists stub_c_exists maybe_interpreted_code 
 
        | isHsBoot src_flavour  -- No further compilation to do
-       -> return (CompOK details rdr_env iface Nothing)
+       -> return (CompOK details iface Nothing)
 
        | otherwise             -- Normal Haskell source files
        -> do
@@ -254,7 +250,7 @@ compile hsc_env mod_summary
           let linkable = LM unlinked_time this_mod
                             (hs_unlinked ++ stub_unlinked)
 
-          return (CompOK details rdr_env iface (Just linkable))
+          return (CompOK details iface (Just linkable))
 
 -----------------------------------------------------------------------------
 -- stub .h and .c files (for foreign export support)
@@ -697,7 +693,7 @@ runPhase (Hsc src_flavour) stop dflags basename suff input_fn get_output_fn _may
                SysTools.touch dflags' "Touching object file" o_file
                return (StopLn, dflags', Just location4, o_file)
 
-           HscRecomp _details _rdr_env _iface 
+           HscRecomp _details _iface 
                      stub_h_exists stub_c_exists
                      _maybe_interpreted_code -> do