import CmdLineOpts ( DynFlags, DynFlag(..) )
import RnMonad
-import RnNames ( getGlobalNames )
+import RnNames ( getGlobalNames, exportsFromAvail )
import RnSource ( rnSourceDecls, rnTyClDecl, rnIfaceRuleDecl, rnInstDecl )
import RnIfaces ( slurpImpDecls, mkImportInfo,
getInterfaceExports, closeDecls,
import IO ( openFile, IOMode(..) )
import HscTypes ( PersistentCompilerState, HomeIfaceTable, HomeSymbolTable,
ModIface(..), WhatsImported(..),
- VersionInfo(..), ImportVersion,
+ VersionInfo(..), ImportVersion, IsExported,
IfaceDecls, mkIfaceDecls, dcl_tycl, dcl_rules, dcl_insts,
GlobalRdrEnv, pprGlobalRdrEnv,
AvailEnv, GenAvailInfo(..), AvailInfo, Avails,
-> HomeIfaceTable -> HomeSymbolTable
-> PersistentCompilerState
-> Module -> RdrNameHsModule
- -> IO (PersistentCompilerState, Maybe (PrintUnqualified, ModIface, [RenamedHsDecl]))
+ -> IO (PersistentCompilerState, Maybe (PrintUnqualified, IsExported, ModIface, [RenamedHsDecl]))
-- Nothing => some error occurred in the renamer
renameModule dflags hit hst old_pcs this_module rdr_module
; (new_pcs, msgs, maybe_rn_stuff) <- initRn dflags hit hst old_pcs this_module
(rename this_module rdr_module)
- ; let print_unqualified :: Name -> Bool -- Is this chap in scope unqualified?
- print_unqualified = case maybe_rn_stuff of
- Just (unqual, _, _) -> unqual
- Nothing -> alwaysQualify
+ ; let print_unqualified = case maybe_rn_stuff of
+ Just (unqual, _, _, _) -> unqual
+ Nothing -> alwaysQualify
-- Print errors from renaming
\begin{code}
rename :: Module -> RdrNameHsModule -> RnMG (Maybe (PrintUnqualified, IsExported, ModIface, [RenamedHsDecl]))
-rename this_module contents@(HsModule _ _ _ imports local_decls mod_deprec loc)
+rename this_module contents@(HsModule _ _ exports imports local_decls mod_deprec loc)
= pushSrcLocRn loc $
-- FIND THE GLOBAL NAME ENVIRONMENT
returnRn Nothing
else
- -- PROCESS EXPORT LIST (but not if we've had errors already)
+ -- PROCESS EXPORT LIST
exportsFromAvail mod_name exports all_avails gbl_env `thenRn` \ export_avails ->
traceRn (text "Local top-level environment" $$