import HscMain ( hscThing, hscStmt, hscTcExpr )
import Module ( moduleUserString )
import TcRnDriver ( mkGlobalContext, getModuleContents )
-import Name ( Name, NamedThing(..), isExternalName )
+import Name ( Name, NamedThing(..), isExternalName, nameModule )
import Id ( idType )
import Type ( tidyType )
import VarEnv ( emptyTidyEnv )
getFixity :: PersistentCompilerState -> Name -> Fixity
getFixity pcs name
| isExternalName name,
- Just iface <- lookupIface hpt pit name,
+ Just iface <- lookupIface hpt pit (nameModule name),
Just (FixitySig _ fixity _) <- lookupNameEnv (mi_fixities iface) name
= fixity
| otherwise
cmUnload :: CmState -> DynFlags -> IO CmState
cmUnload state@CmState{ gmode=mode, pcs=pcs } dflags
= do -- Throw away the old home dir cache
- emptyHomeDirCache
+ flushFinderCache
-- Unload everything the linker knows about
cm_unload mode dflags []
<- if (not objects_allowed)
then return Nothing
- else case ml_obj_file (ms_location summary) of
- Just obj_fn -> maybe_getFileLinkable mod_name obj_fn
- Nothing -> return Nothing
+ else findLinkable mod_name (ms_location summary)
let old_linkable = findModuleLinkable_maybe old_linkables mod_name
return (new_linkables' ++ new_linkables)
-maybe_getFileLinkable :: ModuleName -> FilePath -> IO (Maybe Linkable)
-maybe_getFileLinkable mod obj_fn
- = do obj_exist <- doesFileExist obj_fn
- if not obj_exist
- then return Nothing
- else
- do let stub_fn = case splitFilename3 obj_fn of
- (dir, base, ext) -> dir ++ "/" ++ base ++ ".stub_o"
- stub_exist <- doesFileExist stub_fn
- obj_time <- getModificationTime obj_fn
- if stub_exist
- then return (Just (LM obj_time mod [DotO obj_fn, DotO stub_fn]))
- else return (Just (LM obj_time mod [DotO obj_fn]))
-
hptLinkables :: HomePackageTable -> [Linkable]
-- Get all the linkables from the home package table, one for each module
-- Once the HPT is up to date, these are the ones we should link
= do hspp_fn <- preprocess file
(srcimps,imps,mod_name) <- getImportsFromFile hspp_fn
- let (path, basename, _ext) = splitFilename3 file
+ let (path, basename, ext) = splitFilename3 file
-- GHC.Prim doesn't exist physically, so don't go looking for it.
the_imps = filter (/= gHC_PRIM_Name) imps
- (mod, location)
- <- mkHomeModuleLocn mod_name (path ++ '/':basename) file
+ (mod, location) <- mkHomeModLocation mod_name True{-is a root-}
+ path basename ext
src_timestamp
<- case ml_hs_file location of