From d46347ab6fcac716b1cfda539f6a2e4563c482ed Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Mon, 13 Jun 2022 15:46:29 +1000 Subject: the ghcPrimHack is no longer needed --- app/Server.hs | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) (limited to 'app') diff --git a/app/Server.hs b/app/Server.hs index e67e21f..9eaeca1 100644 --- a/app/Server.hs +++ b/app/Server.hs @@ -1676,7 +1676,7 @@ withModulePath packageInfo' componentId moduleName action = case packageInfo' of PackageInfo packageInfo -> case HM.lookup - (ghcPrimHack packageInfo' moduleName) + moduleName (HCE.moduleNameMap packageInfo) of Just modulePathMap -> case HM.lookup componentId modulePathMap of @@ -1694,7 +1694,7 @@ withModulePath packageInfo' componentId moduleName action = store case eitherModNameMap of Right modNameMap -> - case HM.lookup (ghcPrimHack packageInfo' moduleName) modNameMap of + case HM.lookup moduleName modNameMap of Just componentMap -> case HM.lookup componentId componentMap of Just modulePath -> action modulePath Nothing -> case HM.lookup (HCE.ComponentId "lib") componentMap of @@ -1720,20 +1720,6 @@ withModulePath packageInfo' componentId moduleName action = , toLazyBS $ HCE.packageIdToText packageId ] --- | Workaround for : --- https://github.com/ghc/ghc/blob/ghc-8.2.2-release/compiler/main/Finder.hs#L310-L315 -ghcPrimHack :: PackageInfo -> HCE.HaskellModuleName -> HCE.HaskellModuleName -ghcPrimHack packageInfo' modName@(HCE.HaskellModuleName name) = - case packageInfo' of - PackageInfo packageInfo - | HCE.packageName packageInfo == "ghc-prim" && name == "GHC.Prim" -> - HCE.HaskellModuleName "GHC.Prim_" - | otherwise -> modName - PackageInfoStore (HCE.PackageId packageName _) _ - | packageName == "ghc-prim" && name == "GHC.Prim" -> - HCE.HaskellModuleName "GHC.Prim_" - | otherwise -> modName - parsePackageId :: PackageId -> Maybe (PackageName, Maybe Version) parsePackageId (PackageId text) = case T.splitOn "-" text of -- cgit v1.2.3