diff options
Diffstat (limited to 'compiler/GHC/Rename')
-rw-r--r-- | compiler/GHC/Rename/Module.hs | 18 | ||||
-rw-r--r-- | compiler/GHC/Rename/Names.hs | 6 |
2 files changed, 12 insertions, 12 deletions
diff --git a/compiler/GHC/Rename/Module.hs b/compiler/GHC/Rename/Module.hs index 88ad0fee94..0f17a3c6f2 100644 --- a/compiler/GHC/Rename/Module.hs +++ b/compiler/GHC/Rename/Module.hs @@ -396,21 +396,21 @@ rnHsForeignDecl (ForeignExport { fd_name = name, fd_sig_ty = ty, fd_fe = spec }) -- package, so if they get inlined across a package boundary we'll still -- know where they're from. -- -patchForeignImport :: UnitId -> ForeignImport -> ForeignImport -patchForeignImport unitId (CImport cconv safety fs spec src) - = CImport cconv safety fs (patchCImportSpec unitId spec) src +patchForeignImport :: Unit -> ForeignImport -> ForeignImport +patchForeignImport unit (CImport cconv safety fs spec src) + = CImport cconv safety fs (patchCImportSpec unit spec) src -patchCImportSpec :: UnitId -> CImportSpec -> CImportSpec -patchCImportSpec unitId spec +patchCImportSpec :: Unit -> CImportSpec -> CImportSpec +patchCImportSpec unit spec = case spec of - CFunction callTarget -> CFunction $ patchCCallTarget unitId callTarget + CFunction callTarget -> CFunction $ patchCCallTarget unit callTarget _ -> spec -patchCCallTarget :: UnitId -> CCallTarget -> CCallTarget -patchCCallTarget unitId callTarget = +patchCCallTarget :: Unit -> CCallTarget -> CCallTarget +patchCCallTarget unit callTarget = case callTarget of StaticTarget src label Nothing isFun - -> StaticTarget src label (Just unitId) isFun + -> StaticTarget src label (Just unit) isFun _ -> callTarget {- diff --git a/compiler/GHC/Rename/Names.hs b/compiler/GHC/Rename/Names.hs index c0832b5e35..68f08a9cfd 100644 --- a/compiler/GHC/Rename/Names.hs +++ b/compiler/GHC/Rename/Names.hs @@ -306,7 +306,7 @@ rnImportDecl this_mod -- c.f. GHC.findModule, and #9997 Nothing -> True Just (StringLiteral _ pkg_fs) -> pkg_fs == fsLit "this" || - fsToUnitId pkg_fs == moduleUnitId this_mod)) + fsToUnit pkg_fs == moduleUnit this_mod)) (addErr (text "A module cannot import itself:" <+> ppr imp_mod_name)) -- Check for a missing import list (Opt_WarnMissingImportList also @@ -440,8 +440,8 @@ calculateAvails dflags iface mod_safe' want_boot imported_by = imp_sem_mod : dep_finsts deps | otherwise = dep_finsts deps - pkg = moduleUnitId (mi_module iface) - ipkg = toInstalledUnitId pkg + pkg = moduleUnit (mi_module iface) + ipkg = toUnitId pkg -- Does this import mean we now require our own pkg -- to be trusted? See Note [Trust Own Package] |