summaryrefslogtreecommitdiff
path: root/compiler/GHC/Unit/Module/Graph.hs
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2021-09-30 12:16:02 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-10-19 03:30:16 -0400
commit3d6eb85efcebb5854de880d24f9c8011688fb933 (patch)
treef29362f694fc1e9743291fc51b4c4ac9b5ed32d6 /compiler/GHC/Unit/Module/Graph.hs
parentdf419c1abd7daa3aa0231747582333357b8e9b85 (diff)
downloadhaskell-3d6eb85efcebb5854de880d24f9c8011688fb933.tar.gz
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
Diffstat (limited to 'compiler/GHC/Unit/Module/Graph.hs')
-rw-r--r--compiler/GHC/Unit/Module/Graph.hs21
1 files changed, 10 insertions, 11 deletions
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