--
-----------------------------------------------------------------------------
-#include "../includes/ghcconfig.h"
-
module DriverPipeline (
-- Interfaces for the batch-mode driver
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
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
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)
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
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)
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