From 3d6eb85efcebb5854de880d24f9c8011688fb933 Mon Sep 17 00:00:00 2001 From: Matthew Pickering Date: Thu, 30 Sep 2021 12:16:02 +0100 Subject: driver: Correct output of -fno-code and -dynamic-too Before we would print [1 of 3] Compiling T[boot] ( T.hs-boot, nothing, T.dyn_o ) Which was clearly wrong for two reasons. 1. No dynamic object file was produced for T[boot] 2. The file would be called T.dyn_o-boot if it was produced. Fixes #20300 --- compiler/GHC/Unit/Module/Graph.hs | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'compiler/GHC/Unit') diff --git a/compiler/GHC/Unit/Module/Graph.hs b/compiler/GHC/Unit/Module/Graph.hs index bf7abfea99..822f72b88b 100644 --- a/compiler/GHC/Unit/Module/Graph.hs +++ b/compiler/GHC/Unit/Module/Graph.hs @@ -193,20 +193,19 @@ showModMsg dflags recomp (ModuleNode (ExtendedModSummary mod_summary _)) = [ text (mod_str ++ replicate (max 0 (16 - length mod_str)) ' ') , char '(' , text (op $ msHsFilePath mod_summary) <> char ',' - ] ++ - if gopt Opt_BuildDynamicToo dflags - then [ text obj_file <> char ',' - , text dyn_file - , char ')' - ] - else [ text obj_file, char ')' ] + , message, char ')' ] + where op = normalise mod = moduleName (ms_mod mod_summary) mod_str = showPpr dflags mod ++ hscSourceString (ms_hsc_src mod_summary) dyn_file = op $ msDynObjFilePath mod_summary - obj_file = case backend dflags of - Interpreter | recomp -> "interpreted" - NoBackend -> "nothing" - _ -> (op $ msObjFilePath mod_summary) + obj_file = op $ msObjFilePath mod_summary + message = case backend dflags of + Interpreter | recomp -> text "interpreted" + NoBackend -> text "nothing" + _ -> + if gopt Opt_BuildDynamicToo dflags + then text obj_file <> comma <+> text dyn_file + else text obj_file -- cgit v1.2.1