summaryrefslogtreecommitdiff
path: root/ghc
diff options
context:
space:
mode:
authorMateusz Kowalczyk <fuuzetsu@fuuzetsu.co.uk>2014-11-18 22:21:03 -0600
committerAustin Seipp <austin@well-typed.com>2014-11-19 17:03:05 -0600
commit7ef0971a016d45915d1fa88a308db80a5c9e97ba (patch)
treeffdca78a25d4f57128a11d3affdd53b00f3c1de7 /ghc
parent5c098930a56286e5144cb5a24aae3db90ed741bd (diff)
downloadhaskell-7ef0971a016d45915d1fa88a308db80a5c9e97ba.tar.gz
Filter input to abiHash early
Summary: This is already done near the only call site so why not. It is ugly to see it at 'abiHash' itself. Test Plan: validate Reviewers: austin Reviewed By: austin Subscribers: thomie, carter Differential Revision: https://phabricator.haskell.org/D491
Diffstat (limited to 'ghc')
-rw-r--r--ghc/Main.hs12
1 files changed, 9 insertions, 3 deletions
diff --git a/ghc/Main.hs b/ghc/Main.hs
index c1ee2478b5..4fd7803f7b 100644
--- a/ghc/Main.hs
+++ b/ghc/Main.hs
@@ -236,7 +236,7 @@ main' postLoadMode dflags0 args flagWarnings = do
StopBefore p -> liftIO (oneShot hsc_env p srcs)
DoInteractive -> ghciUI srcs Nothing
DoEval exprs -> ghciUI srcs $ Just $ reverse exprs
- DoAbiHash -> abiHash srcs
+ DoAbiHash -> abiHash (map fst srcs)
ShowPackages -> liftIO $ showPackages dflags6
liftIO $ dumpFinalStats dflags6
@@ -798,7 +798,13 @@ the package chagnes, so during registration Cabal calls ghc --abi-hash
to get a hash of the package's ABI.
-}
-abiHash :: [(String, Maybe Phase)] -> Ghc ()
+-- | Print ABI hash of input modules.
+--
+-- The resulting hash is the MD5 of the GHC version used (Trac #5328,
+-- see 'hiVersion') and of the existing ABI hash from each module (see
+-- 'mi_mod_hash').
+abiHash :: [String] -- ^ List of module names
+ -> Ghc ()
abiHash strs = do
hsc_env <- getSession
let dflags = hsc_dflags hsc_env
@@ -813,7 +819,7 @@ abiHash strs = do
_error -> throwGhcException $ CmdLineError $ showSDoc dflags $
cannotFindInterface dflags modname r
- mods <- mapM find_it (map fst strs)
+ mods <- mapM find_it strs
let get_iface modl = loadUserInterface False (text "abiHash") modl
ifaces <- initIfaceCheck hsc_env $ mapM get_iface mods