Commit 896d216d authored by Edward Z. Yang's avatar Edward Z. Yang
Browse files

Annotate initIfaceCheck with usage information.


Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
parent b2c5e4ce
......@@ -610,7 +610,7 @@ getLinkDeps hsc_env hpt pls replace_osuf span mods
= return (uniqDSetToList acc_mods, uniqDSetToList acc_pkgs)
follow_deps (mod:mods) acc_mods acc_pkgs
= do
mb_iface <- initIfaceCheck hsc_env $
mb_iface <- initIfaceCheck (text "getLinkDeps") hsc_env $
loadInterface msg mod (ImportByUser False)
iface <- case mb_iface of
Maybes.Failed err -> throwGhcExceptionIO (ProgramError (showSDoc dflags err))
......
......@@ -952,7 +952,7 @@ checkOldIface hsc_env mod_summary source_modified maybe_iface
showPass dflags $
"Checking old interface for " ++
(showPpr dflags $ ms_mod mod_summary)
initIfaceCheck hsc_env $
initIfaceCheck (text "checkOldIface") hsc_env $
check_old_iface hsc_env mod_summary source_modified maybe_iface
check_old_iface
......
......@@ -1422,7 +1422,7 @@ typecheckLoop dflags hsc_env mods = do
new_hpt <-
fixIO $ \new_hpt -> do
let new_hsc_env = hsc_env{ hsc_HPT = new_hpt }
mds <- initIfaceCheck new_hsc_env $
mds <- initIfaceCheck (text "typecheckLoop") new_hsc_env $
mapM (typecheckIface . hm_iface) hmis
let new_hpt = addListToHpt old_hpt
(zip mods [ hmi{ hm_details = details }
......
......@@ -739,7 +739,7 @@ genModDetails :: HscEnv -> ModIface -> IO ModDetails
genModDetails hsc_env old_iface
= do
new_details <- {-# SCC "tcRnIface" #-}
initIfaceCheck hsc_env (typecheckIface old_iface)
initIfaceCheck (text "genModDetails") hsc_env (typecheckIface old_iface)
dumpIfaceStats hsc_env
return new_details
......
......@@ -1619,15 +1619,15 @@ initIfaceTcRn thing_inside
; get_type_env = readTcRef (tcg_type_env_var tcg_env) }
; setEnvs (if_env, ()) thing_inside }
initIfaceCheck :: HscEnv -> IfG a -> IO a
initIfaceCheck :: SDoc -> HscEnv -> IfG a -> IO a
-- Used when checking the up-to-date-ness of the old Iface
-- Initialise the environment with no useful info at all
initIfaceCheck hsc_env do_this
initIfaceCheck doc hsc_env do_this
= do let rec_types = case hsc_type_env_var hsc_env of
Just (mod,var) -> Just (mod, readTcRef var)
Nothing -> Nothing
gbl_env = IfGblEnv {
if_doc = text "initIfaceCheck",
if_doc = text "initIfaceCheck" <+> doc,
if_rec_types = rec_types
}
initTcRnIf 'i' hsc_env gbl_env () do_this
......
......@@ -891,7 +891,7 @@ abiHash strs = do
mods <- mapM find_it strs
let get_iface modl = loadUserInterface False (text "abiHash") modl
ifaces <- initIfaceCheck hsc_env $ mapM get_iface mods
ifaces <- initIfaceCheck (text "abiHash") hsc_env $ mapM get_iface mods
bh <- openBinMem (3*1024) -- just less than a block
put_ bh hiVersion
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment