X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fmain%2FDriverPipeline.hs;h=690328d8070021310feafa4cd573fae9b31c7d65;hb=2a8cdc3aee5997374273e27365f92c161aca8453;hp=d66f1473b0c53b8ec07eff4f69e8255e8bba2ade;hpb=ee565d464248078a4f2d46f98667aa4fcdc56db4;p=ghc-hetmet.git diff --git a/compiler/main/DriverPipeline.hs b/compiler/main/DriverPipeline.hs index d66f147..690328d 100644 --- a/compiler/main/DriverPipeline.hs +++ b/compiler/main/DriverPipeline.hs @@ -144,8 +144,8 @@ compile hsc_env mod_summary maybe_old_linkable old_iface mod_index nmods = do extCoreName = basename ++ ".hcr" } -- -no-recomp should also work with --make - let do_recomp = dopt Opt_RecompChecking dflags - source_unchanged = isJust maybe_old_linkable && do_recomp + let force_recomp = dopt Opt_ForceRecomp dflags + source_unchanged = isJust maybe_old_linkable && not force_recomp hsc_env' = hsc_env { hsc_dflags = dflags' } object_filename = ml_obj_file location @@ -302,7 +302,7 @@ link BatchCompile dflags batch_attempt_linking hpt | Right t <- e_exe_time = any (t <) (map linkableTime linkables) - if dopt Opt_RecompChecking dflags && not linking_needed + if not (dopt Opt_ForceRecomp dflags) && not linking_needed then do debugTraceMsg dflags 2 (text exe_file <+> ptext SLIT("is up to date, linking not required.")) return Succeeded else do @@ -688,9 +688,9 @@ runPhase (Hsc src_flavour) stop dflags0 basename suff input_fn get_output_fn _ma -- date wrt M.hs (or M.o doesn't exist) so we must recompile regardless. src_timestamp <- getModificationTime (basename `joinFileExt` suff) - let do_recomp = dopt Opt_RecompChecking dflags + let force_recomp = dopt Opt_ForceRecomp dflags source_unchanged <- - if not do_recomp || not (isStopLn stop) + if force_recomp || not (isStopLn stop) -- Set source_unchanged to False unconditionally if -- (a) recompilation checker is off, or -- (b) we aren't going all the way to .o file (e.g. ghc -S) @@ -789,7 +789,7 @@ runPhase Cmm stop dflags basename suff input_fn get_output_fn maybe_loc -- way too many hacks, and I can't say I've ever used it anyway. runPhase cc_phase stop dflags basename suff input_fn get_output_fn maybe_loc - | cc_phase `eqPhase` Cc || cc_phase `eqPhase` HCc + | cc_phase `eqPhase` Cc || cc_phase `eqPhase` Ccpp || cc_phase `eqPhase` HCc = do let cc_opts = getOpts dflags opt_c hcc = cc_phase `eqPhase` HCc @@ -851,7 +851,8 @@ runPhase cc_phase stop dflags basename suff input_fn get_output_fn maybe_loc -- compiling .hc files, by adding the -x c option. -- Also useful for plain .c files, just in case GHC saw a -- -x c option. - [ SysTools.Option "-x", SysTools.Option "c"] ++ + [ SysTools.Option "-x", if cc_phase `eqPhase` Ccpp + then SysTools.Option "c++" else SysTools.Option "c"] ++ [ SysTools.FileOption "" input_fn , SysTools.Option "-o" , SysTools.FileOption "" output_fn