- if not carry_on
- then do let (_,keep,final_suffix) = last phases
- ofile <- outputFileName True keep final_suffix
- return ofile
- else do -- carry on ...
-
- pipeLoop phases output_fn do_linking use_ofile orig_basename orig_suffix
-
+ case mbCarryOn of
+ Nothing -> do
+ let (_,keep,final_suffix) = last phases
+ ofile <- outputFileName True keep final_suffix
+ return (ofile, final_suffix)
+ -- carry on ...
+ Just fn ->
+ {-
+ Notice that in order to keep the invariant that we can
+ determine a compilation pipeline's 'start phase' just
+ by looking at the input filename, the input filename
+ to the next stage/phase is associated here with the suffix
+ of the output file, *even* if it does not have that
+ suffix in reality.
+
+ Why is this important? Because we may run a compilation
+ pipeline in stages (cf. Main.main.compileFile's two stages),
+ so when generating the next stage we need to be precise
+ about what kind of file (=> suffix) is given as input.
+
+ [Not having to generate a pipeline in stages seems like
+ the right way to go, but I've punted on this for now --sof]
+
+ -}
+ pipeLoop phases (fn, o_suffix) do_linking use_ofile
+ orig_basename orig_suffix