From 44aa6bcb3941586a4fef9c1b84fce98ad4ef975c Mon Sep 17 00:00:00 2001 From: simonmar Date: Tue, 12 Mar 2002 10:41:48 +0000 Subject: [PATCH] [project @ 2002-03-12 10:41:48 by simonmar] When deciding whether the source for a module is unchanged, don't look at the file referred to in the argument of '-o' unless it really is the object file for this compilation (it might be the binary instead). MERGE TO STABLE --- ghc/compiler/main/DriverPipeline.hs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/ghc/compiler/main/DriverPipeline.hs b/ghc/compiler/main/DriverPipeline.hs index ec45002..fb98729 100644 --- a/ghc/compiler/main/DriverPipeline.hs +++ b/ghc/compiler/main/DriverPipeline.hs @@ -529,10 +529,13 @@ run_phase Hsc basename suff input_fn output_fn do_recomp <- readIORef v_Recomp todo <- readIORef v_GhcMode expl_o_file <- readIORef v_Output_file - let o_file = - case expl_o_file of - Nothing -> unJust "source_unchanged" (ml_obj_file location) - Just x -> x + + let o_file -- if the -o option is given and IT IS THE OBJECT FILE FOR + -- THIS COMPILATION, then use that to determine if the + -- source is unchanged. + | Just x <- expl_o_file, todo == StopBefore Ln = x + | otherwise = unJust "source_unchanged" (ml_obj_file location) + source_unchanged <- if not (do_recomp && ( todo == DoLink || todo == StopBefore Ln )) then return False -- 1.7.10.4