From: simonmar Date: Wed, 2 Feb 2005 10:14:04 +0000 (+0000) Subject: [project @ 2005-02-02 10:14:01 by simonmar] X-Git-Tag: Initial_conversion_from_CVS_complete~1129 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=a2a9410c4d310e2a7a7fd2a59775b442609d7a57;p=ghc-hetmet.git [project @ 2005-02-02 10:14:01 by simonmar] Fix isLinkMode and adjust formatting a little --- diff --git a/ghc/compiler/main/DriverPipeline.hs b/ghc/compiler/main/DriverPipeline.hs index cd19d6c..55fed5c 100644 --- a/ghc/compiler/main/DriverPipeline.hs +++ b/ghc/compiler/main/DriverPipeline.hs @@ -93,10 +93,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 +105,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 diff --git a/ghc/compiler/main/DriverState.hs b/ghc/compiler/main/DriverState.hs index 71b61d9..392ed14 100644 --- a/ghc/compiler/main/DriverState.hs +++ b/ghc/compiler/main/DriverState.hs @@ -78,9 +78,11 @@ isInterpretiveMode _ = False isMakeMode DoMake = True isMakeMode _ = False -isLinkMode (StopBefore p) = True -isLinkMode DoMake = True -isLinkMode _ = False +-- True if we are going to attempt to link in this mode. +-- (we might not actually link, depending on the GhcLink flag) +isLinkMode (StopBefore StopLn) = True +isLinkMode DoMake = True +isLinkMode _ = False isCompManagerMode DoMake = True isCompManagerMode DoInteractive = True