import TysWiredIn ( mkListTy, unitTy )
import IdInfo ( GlobalIdDetails(..) )
import SrcLoc ( interactiveSrcLoc, unLoc )
-import Var ( setGlobalIdDetails )
+import Var ( globaliseId )
import Name ( nameOccName, nameModuleName )
import NameEnv ( delListFromNameEnv )
import PrelNames ( iNTERACTIVE, ioTyConName, printName, monadNames, itName, returnIOName )
reportDeprecations tcg_env ;
-- Process the export list
- export_avails <- exportsFromAvail (isJust maybe_mod) exports ;
+ exports <- exportsFromAvail (isJust maybe_mod) exports ;
+{- Jan 04: I don't think this is necessary any more; usage info is derived from tcg_dus
-- Get any supporting decls for the exports that have not already
-- been sucked in for the declarations in the body of the module.
-- (This can happen if something is imported only to be re-exported.)
-- We don't need the results, but sucking them in may side-effect
-- the ExternalPackageState, apart from recording usage
mappM (tcLookupGlobal . availName) export_avails ;
+-}
-- Check whether the entire module is deprecated
-- This happens only once per module
let { mod_deprecs = checkModDeprec mod_deprec } ;
-- Add exports and deprecations to envt
- let { export_fvs = availsToNameSet export_avails ;
- final_env = tcg_env { tcg_exports = export_avails,
- tcg_dus = tcg_dus tcg_env `plusDU` usesOnly export_fvs,
+ let { final_env = tcg_env { tcg_exports = exports,
+ tcg_dus = tcg_dus tcg_env `plusDU` usesOnly exports,
tcg_deprecs = tcg_deprecs tcg_env `plusDeprecs`
mod_deprecs }
-- A module deprecation over-rides the earlier ones
-- important: otherwise when we come to compile an expression
-- using these ids later, the byte code generator will consider
-- the occurrences to be free rather than global.
- global_ids = map globaliseId bound_ids ;
- globaliseId id = setGlobalIdDetails id VanillaGlobal ;
+ global_ids = map (globaliseId VanillaGlobal) bound_ids ;
-- Update the interactive context
rn_env = ic_rn_local_env ictxt ;
toIfaceDecl :: InteractiveContext -> TyThing -> IfaceDecl
toIfaceDecl ictxt thing
- = tyThingToIfaceDecl True {- Discard IdInfo -} ext_nm thing
+ = tyThingToIfaceDecl True {- Discard IdInfo -} (const False) {- Show data cons -}
+ ext_nm thing
where
unqual = icPrintUnqual ictxt
ext_nm n | unqual n = LocalTop (nameOccName n) -- What a hack
-- Wrap up
let {
bndrs = bindersOfBinds core_binds ;
- my_exports = map (Avail . idName) bndrs ;
+ my_exports = mkNameSet (map idName bndrs) ;
-- ToDo: export the data types also?
final_type_env = extendTypeEnvWithIds (tcg_type_env tcg_env) bndrs ;