summaryrefslogtreecommitdiff
path: root/compiler/main
diff options
context:
space:
mode:
authorSylvain HENRY <hsyl20@gmail.com>2016-11-11 22:54:05 -0500
committerBen Gamari <ben@smart-cactus.org>2016-11-11 22:54:07 -0500
commit587dcccfdfa7a319e27300a4f3885071060b1f8e (patch)
tree55f4e8748192e532b6811bad65615c017d1dcea8 /compiler/main
parent4e0b8f4d80a02be797d4fed099c1195f1bcd1189 (diff)
downloadhaskell-587dcccfdfa7a319e27300a4f3885071060b1f8e.tar.gz
Make default output less verbose (source/object paths)
Reviewers: simonmar, mpickering, austin, bgamari Reviewed By: bgamari Subscribers: mpickering, nomeata, thomie Differential Revision: https://phabricator.haskell.org/D2679 GHC Trac Issues: #12807
Diffstat (limited to 'compiler/main')
-rw-r--r--compiler/main/DynFlags.hs4
-rw-r--r--compiler/main/HscTypes.hs29
2 files changed, 19 insertions, 14 deletions
diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs
index 479b50d0ea..126b4575f6 100644
--- a/compiler/main/DynFlags.hs
+++ b/compiler/main/DynFlags.hs
@@ -392,6 +392,7 @@ data GeneralFlag
| Opt_WarnIsError -- -Werror; makes warnings fatal
| Opt_ShowWarnGroups -- Show the group a warning belongs to
+ | Opt_ShowSourcePaths -- Show module source/object paths
| Opt_PrintExplicitForalls
| Opt_PrintExplicitKinds
@@ -3487,7 +3488,8 @@ fFlagsDeps = [
flagSpec "vectorise" Opt_Vectorise,
flagSpec "version-macros" Opt_VersionMacros,
flagSpec "worker-wrapper" Opt_WorkerWrapper,
- flagSpec "show-warning-groups" Opt_ShowWarnGroups
+ flagSpec "show-warning-groups" Opt_ShowWarnGroups,
+ flagSpec "show-source-paths" Opt_ShowSourcePaths
]
-- | These @-f\<blah\>@ flags can all be reversed with @-fno-\<blah\>@
diff --git a/compiler/main/HscTypes.hs b/compiler/main/HscTypes.hs
index 44b5634008..cd1878ffe9 100644
--- a/compiler/main/HscTypes.hs
+++ b/compiler/main/HscTypes.hs
@@ -2637,20 +2637,23 @@ instance Outputable ModSummary where
]
showModMsg :: DynFlags -> HscTarget -> Bool -> ModSummary -> String
-showModMsg dflags target recomp mod_summary
- = showSDoc dflags $
- hsep [text (mod_str ++ replicate (max 0 (16 - length mod_str)) ' '),
- char '(', text (normalise $ msHsFilePath mod_summary) <> comma,
- case target of
- HscInterpreted | recomp
- -> text "interpreted"
- HscNothing -> text "nothing"
- _ -> text (normalise $ msObjFilePath mod_summary),
- char ')']
- where
+showModMsg dflags target recomp mod_summary = showSDoc dflags $ hcat
+ [ text (mod_str ++ replicate (max 1 (17 - length mod_str)) ' ')
+ , char '('
+ , text (op $ msHsFilePath mod_summary)
+ , text " -> "
+ , case target of
+ HscInterpreted | recomp -> text "interpreted"
+ HscNothing -> text "nothing"
+ _ -> text (op $ msObjFilePath mod_summary)
+ , char ')'
+ ]
+ where
+ op = if verbosity dflags > 1 || gopt Opt_ShowSourcePaths dflags
+ then normalise
+ else takeExtension
mod = moduleName (ms_mod mod_summary)
- mod_str = showPpr dflags mod
- ++ hscSourceString (ms_hsc_src mod_summary)
+ mod_str = showPpr dflags mod ++ hscSourceString (ms_hsc_src mod_summary)
{-
************************************************************************