setHiDir f d = d{ hiDir = Just f}
setStubDir f d = d{ stubDir = Just f, includePaths = f : includePaths d }
-- -stubdir D adds an implicit -I D, so that gcc can find the _stub.h file
- -- #included from the .hc file when compiling with -fvia-C.
+ -- \#included from the .hc file when compiling with -fvia-C.
setObjectSuf f d = d{ objectSuf = f}
setHiSuf f d = d{ hiSuf = f}
stub_basename = stub_basename0 ++ "_stub"
-- this is the filename we're going to use when
- -- #including the stub_h file from the .hc file.
+ -- \#including the stub_h file from the .hc file.
-- Without -stubdir, we just #include the basename
-- (eg. for a module A.B, we #include "B_stub.h"),
-- relying on the fact that we add an implicit -I flag
-- for the directory in which the source file resides
-- (see DriverPipeline.hs). With -stubdir, we
- -- #include "A/B.h", assuming that the user has added
+ -- \#include "A/B.h", assuming that the user has added
-- -I<dir> along with -stubdir <dir>.
include_basename
| Just _ <- stubdir = mod_basename
if ms_hs_date old_summary == src_timestamp
then do -- update the object-file timestamp
obj_timestamp <-
- if isObjectTarget (hscTarget (hsc_dflags hsc_env)) -- #1205
+ if isObjectTarget (hscTarget (hsc_dflags hsc_env)) -- bug #1205
then getObjTimestamp location False
else return Nothing
return old_summary{ ms_obj_date = obj_timestamp }
-- Drop external-pkg
ASSERT(modulePackageId mod /= thisPackage dflags)
return Nothing
- where
err -> noModError dflags loc wanted_mod err
-- Not found
stg_binds hpc_info
--- Optionally run experimental Cmm transformations ---
cmms <- optionallyConvertAndOrCPS hsc_env cmms
- -- ^ unless certain dflags are on, the identity function
+ -- unless certain dflags are on, the identity function
------------------ Code output -----------------------
rawcmms <- cmmToRawCmm cmms
(_stub_h_exists, stub_c_exists)
| NoPackage PackageId
-- the requested package was not found
| FoundMultiple [PackageId]
- -- *error*: both in multiple packages
+ -- _error_: both in multiple packages
| PackageHidden PackageId
-- for an explicit source import: the package containing the module is
-- not exposed.
-- this module, rather than for *just* this module.
-- Reason: when looking up an instance we don't want to have to
-- look at each module in the home package in turn
- mg_inst_env :: InstEnv, -- Class instance enviroment fro
- -- *home-package* modules (including
- -- this one); c.f. tcg_inst_env
- mg_fam_inst_env :: FamInstEnv -- Type-family instance enviroment
- -- for *home-package* modules (including
- -- this one); c.f. tcg_fam_inst_env
+ mg_inst_env :: InstEnv,
+ -- ^ Class instance enviroment from /home-package/ modules (including
+ -- this one); c.f. tcg_inst_env
+ mg_fam_inst_env :: FamInstEnv
+ -- ^ Type-family instance enviroment for /home-package/ modules
+ -- (including this one); c.f. tcg_fam_inst_env
}
-- A CoreModule consists of just the fields of a ModGuts that are needed for
-- thread doesn't die when it receives the exception... "this thread
-- is not responding".
--
--- Careful here: there may be ^C exceptions flying around, so we start
--- the new thread blocked (forkIO inherits block from the parent,
--- #1048), and unblock only while we execute the user's code. We
--- can't afford to lose the final putMVar, otherwise deadlock
--- ensues. (#1583, #1922, #1946)
+-- Careful here: there may be ^C exceptions flying around, so we start the new
+-- thread blocked (forkIO inherits block from the parent, #1048), and unblock
+-- only while we execute the user's code. We can't afford to lose the final
+-- putMVar, otherwise deadlock ensues. (#1583, #1922, #1946)
sandboxIO :: DynFlags -> MVar Status -> IO [HValue] -> IO Status
sandboxIO dflags statusMVar thing =
block $ do -- fork starts blocked
getInfo :: Session -> Name -> IO (Maybe (TyThing,Fixity,[Instance]))
getInfo s name
= withSession s $ \hsc_env ->
- do { mb_stuff <- tcRnGetInfo hsc_env name
- ; case mb_stuff of
- Nothing -> return Nothing
- Just (thing, fixity, ispecs) -> do
- { let rdr_env = ic_rn_gbl_env (hsc_IC hsc_env)
- ; return (Just (thing, fixity, filter (plausible rdr_env) ispecs)) } }
+ do mb_stuff <- tcRnGetInfo hsc_env name
+ case mb_stuff of
+ Nothing -> return Nothing
+ Just (thing, fixity, ispecs) -> do
+ let rdr_env = ic_rn_gbl_env (hsc_IC hsc_env)
+ return (Just (thing, fixity, filter (plausible rdr_env) ispecs))
where
plausible rdr_env ispec -- Dfun involving only names that are in ic_rn_glb_env
= all ok $ nameSetToList $ tyClsNamesOfType $ idType $ instanceDFunId ispec