Commit a2a9410c authored by simonmar's avatar simonmar
Browse files

[project @ 2005-02-02 10:14:01 by simonmar]

Fix isLinkMode and adjust formatting a little
parent b5330f14
...@@ -93,10 +93,11 @@ compileFile mode dflags src = do ...@@ -93,10 +93,11 @@ compileFile mode dflags src = do
ghc_link <- readIORef v_GhcLink -- Set by -c or -no-link ghc_link <- readIORef v_GhcLink -- Set by -c or -no-link
-- When linking, the -o argument refers to the linker's output. -- When linking, the -o argument refers to the linker's output.
-- otherwise, we use it as the name for the pipeline's output. -- otherwise, we use it as the name for the pipeline's output.
let maybe_o_file | isLinkMode mode && not (isNoLink ghc_link) let maybe_o_file
= Nothing -- -o foo applies to linker | isLinkMode mode && not (isNoLink ghc_link) = Nothing
| otherwise -- -o foo applies to linker
= o_file -- -o foo applies to the file we are compiling now | otherwise = o_file
-- -o foo applies to the file we are compiling now
stop_phase = case mode of stop_phase = case mode of
StopBefore As | split -> SplitAs StopBefore As | split -> SplitAs
...@@ -104,8 +105,8 @@ compileFile mode dflags src = do ...@@ -104,8 +105,8 @@ compileFile mode dflags src = do
other -> StopLn other -> StopLn
mode_flag_string <- readIORef v_GhcModeFlag mode_flag_string <- readIORef v_GhcModeFlag
(_, out_file) <- runPipeline stop_phase mode_flag_string dflags True maybe_o_file (_, out_file) <- runPipeline stop_phase mode_flag_string dflags
src Nothing{-no ModLocation-} True maybe_o_file src Nothing{-no ModLocation-}
return out_file return out_file
......
...@@ -78,9 +78,11 @@ isInterpretiveMode _ = False ...@@ -78,9 +78,11 @@ isInterpretiveMode _ = False
isMakeMode DoMake = True isMakeMode DoMake = True
isMakeMode _ = False isMakeMode _ = False
isLinkMode (StopBefore p) = True -- True if we are going to attempt to link in this mode.
isLinkMode DoMake = True -- (we might not actually link, depending on the GhcLink flag)
isLinkMode _ = False isLinkMode (StopBefore StopLn) = True
isLinkMode DoMake = True
isLinkMode _ = False
isCompManagerMode DoMake = True isCompManagerMode DoMake = True
isCompManagerMode DoInteractive = True isCompManagerMode DoInteractive = True
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment