+ let location3 | Just fn <- ohi = location2{ ml_hi_file = fn }
+ | otherwise = location2
+
+ -- Take -o into account if present
+ -- Very like -ohi, but we must *only* do this if we aren't linking
+ -- (If we're linking then the -o applies to the linked thing, not to
+ -- the object file for one module.)
+ -- Note the nasty duplication with the same computation in compileFile above
+ expl_o_file <- readIORef v_Output_file
+ no_link <- readIORef v_NoLink
+ let location4 | Just ofile <- expl_o_file, no_link
+ = location3 { ml_obj_file = ofile }
+ | otherwise = location3
+
+ -- Tell the finder cache about this module
+ addHomeModuleToFinder mod_name location4
+
+ -- Make the ModSummary to hand to hscMain
+ src_timestamp <- getModificationTime (basename ++ '.':suff)
+ let
+ unused_field = panic "runPhase:ModSummary field"
+ -- Some fields are not looked at by hscMain
+ mod_summary = ModSummary { ms_mod = mod_name,
+ ms_hsc_src = src_flavour,
+ ms_hspp_file = Just input_fn,
+ ms_hspp_buf = hspp_buf,
+ ms_location = location4,
+ ms_hs_date = src_timestamp,
+ ms_imps = unused_field,
+ ms_srcimps = unused_field }
+
+ o_file = ml_obj_file location4 -- The real object file
+
+
+ -- Figure out if the source has changed, for recompilation avoidance.