diff options
author | Edward Z. Yang <ezyang@cs.stanford.edu> | 2015-10-11 11:03:10 -0700 |
---|---|---|
committer | Edward Z. Yang <ezyang@cs.stanford.edu> | 2015-10-14 21:40:49 -0700 |
commit | b92a51f5e235fc22a9ae0d76735b50f095665fb7 (patch) | |
tree | 27eb41de475255206185e68c535c2d899012fa1b /compiler/rename | |
parent | 5b0191f74ab05b187f81ea037623338a615b1619 (diff) | |
download | haskell-b92a51f5e235fc22a9ae0d76735b50f095665fb7.tar.gz |
Rename package key to unit ID, and installed package ID to component ID.
Comes with Haddock submodule update.
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Diffstat (limited to 'compiler/rename')
-rw-r--r-- | compiler/rename/RnNames.hs | 4 | ||||
-rw-r--r-- | compiler/rename/RnSource.hs | 22 |
2 files changed, 13 insertions, 13 deletions
diff --git a/compiler/rename/RnNames.hs b/compiler/rename/RnNames.hs index 0cdf38c693..a92c8d9c6a 100644 --- a/compiler/rename/RnNames.hs +++ b/compiler/rename/RnNames.hs @@ -217,7 +217,7 @@ rnImportDecl this_mod -- c.f. GHC.findModule, and Trac #9997 Nothing -> True Just (StringLiteral _ pkg_fs) -> pkg_fs == fsLit "this" || - fsToPackageKey pkg_fs == modulePackageKey this_mod)) + fsToUnitId pkg_fs == moduleUnitId this_mod)) (addErr (ptext (sLit "A module cannot import itself:") <+> ppr imp_mod_name)) -- Check for a missing import list (Opt_WarnMissingImportList also @@ -332,7 +332,7 @@ calculateAvails dflags iface mod_safe' want_boot = imp_mod : dep_finsts deps | otherwise = dep_finsts deps - pkg = modulePackageKey (mi_module iface) + pkg = moduleUnitId (mi_module iface) -- Does this import mean we now require our own pkg -- to be trusted? See Note [Trust Own Package] diff --git a/compiler/rename/RnSource.hs b/compiler/rename/RnSource.hs index 820f0b045a..19f05c3ca2 100644 --- a/compiler/rename/RnSource.hs +++ b/compiler/rename/RnSource.hs @@ -402,8 +402,8 @@ rnHsForeignDecl (ForeignImport name ty _ spec) ; (ty', fvs) <- rnLHsType (ForeignDeclCtx name) ty -- Mark any PackageTarget style imports as coming from the current package - ; let packageKey = thisPackage $ hsc_dflags topEnv - spec' = patchForeignImport packageKey spec + ; let unitId = thisPackage $ hsc_dflags topEnv + spec' = patchForeignImport unitId spec ; return (ForeignImport name' ty' noForeignImportCoercionYet spec', fvs) } @@ -420,21 +420,21 @@ rnHsForeignDecl (ForeignExport name ty _ spec) -- package, so if they get inlined across a package boundry we'll still -- know where they're from. -- -patchForeignImport :: PackageKey -> ForeignImport -> ForeignImport -patchForeignImport packageKey (CImport cconv safety fs spec src) - = CImport cconv safety fs (patchCImportSpec packageKey spec) src +patchForeignImport :: UnitId -> ForeignImport -> ForeignImport +patchForeignImport unitId (CImport cconv safety fs spec src) + = CImport cconv safety fs (patchCImportSpec unitId spec) src -patchCImportSpec :: PackageKey -> CImportSpec -> CImportSpec -patchCImportSpec packageKey spec +patchCImportSpec :: UnitId -> CImportSpec -> CImportSpec +patchCImportSpec unitId spec = case spec of - CFunction callTarget -> CFunction $ patchCCallTarget packageKey callTarget + CFunction callTarget -> CFunction $ patchCCallTarget unitId callTarget _ -> spec -patchCCallTarget :: PackageKey -> CCallTarget -> CCallTarget -patchCCallTarget packageKey callTarget = +patchCCallTarget :: UnitId -> CCallTarget -> CCallTarget +patchCCallTarget unitId callTarget = case callTarget of StaticTarget src label Nothing isFun - -> StaticTarget src label (Just packageKey) isFun + -> StaticTarget src label (Just unitId) isFun _ -> callTarget {- |