summaryrefslogtreecommitdiff
path: root/ghc
diff options
context:
space:
mode:
authorAlexander Lukyanov <alex.dontexist@gmail.com>2016-03-12 12:03:47 +0100
committerBen Gamari <ben@smart-cactus.org>2016-03-12 12:03:51 +0100
commit41051dd846c3a7fc01cbb8ad3b7dd2b4332f7f0b (patch)
tree72389a54ec032f8223be1402b917c56c9617d351 /ghc
parent4d791b4f77975422df38f6b43084008edd097f1b (diff)
downloadhaskell-41051dd846c3a7fc01cbb8ad3b7dd2b4332f7f0b.tar.gz
ghci: add message when reusing compiled code #9887
Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1991 GHC Trac Issues: #9887
Diffstat (limited to 'ghc')
-rw-r--r--ghc/GHCi/UI.hs21
1 files changed, 14 insertions, 7 deletions
diff --git a/ghc/GHCi/UI.hs b/ghc/GHCi/UI.hs
index cc180f27ff..a335aea827 100644
--- a/ghc/GHCi/UI.hs
+++ b/ghc/GHCi/UI.hs
@@ -51,7 +51,7 @@ import GHC ( LoadHowMuch(..), Target(..), TargetId(..), InteractiveImport(..),
import HsImpExp
import HsSyn
import HscTypes ( tyThingParent_maybe, handleFlagWarnings, getSafeMode, hsc_IC,
- setInteractivePrintName, hsc_dflags )
+ setInteractivePrintName, hsc_dflags, msObjFilePath )
import Module
import Name
import Packages ( trusted, getPackageDetails, listVisibleModuleNames, pprFlag )
@@ -1569,10 +1569,9 @@ afterLoad :: SuccessFlag
afterLoad ok retain_context = do
lift revertCAFs -- always revert CAFs on load.
lift discardTickArrays
- loaded_mod_summaries <- getLoadedModules
- let loaded_mods = map GHC.ms_mod loaded_mod_summaries
+ loaded_mods <- getLoadedModules
modulesLoadedMsg ok loaded_mods
- lift $ setContextAfterLoad retain_context loaded_mod_summaries
+ lift $ setContextAfterLoad retain_context loaded_mods
setContextAfterLoad :: Bool -> [GHC.ModSummary] -> GHCi ()
setContextAfterLoad keep_ctxt [] = do
@@ -1646,14 +1645,22 @@ keepPackageImports = filterM is_pkg_import
mod_name = unLoc (ideclName d)
-modulesLoadedMsg :: SuccessFlag -> [Module] -> InputT GHCi ()
+modulesLoadedMsg :: SuccessFlag -> [GHC.ModSummary] -> InputT GHCi ()
modulesLoadedMsg ok mods = do
dflags <- getDynFlags
unqual <- GHC.getPrintUnqual
+ let mod_name mod = do
+ is_interpreted <- GHC.isModuleInterpreted mod
+ return $ if is_interpreted
+ then ppr (GHC.ms_mod mod)
+ else ppr (GHC.ms_mod mod)
+ <> text " ("
+ <> text (normalise $ msObjFilePath mod)
+ <> text ")" -- fix #9887
+ mod_names <- mapM mod_name mods
let mod_commas
| null mods = text "none."
- | otherwise = hsep (
- punctuate comma (map ppr mods)) <> text "."
+ | otherwise = hsep (punctuate comma mod_names) <> text "."
status = case ok of
Failed -> text "Failed"
Succeeded -> text "Ok"