diff options
author | Yuchen Pei <hi@ypei.me> | 2022-06-13 15:46:29 +1000 |
---|---|---|
committer | Yuchen Pei <hi@ypei.me> | 2022-06-13 15:46:29 +1000 |
commit | d46347ab6fcac716b1cfda539f6a2e4563c482ed (patch) | |
tree | 6321ca9aee4db7b60a5ed99b853c53db4cab6ff4 /app | |
parent | 8793dfc66dcab759a95e4f6ab98e07afbc45784b (diff) |
the ghcPrimHack is no longer needed
Diffstat (limited to 'app')
-rw-r--r-- | app/Server.hs | 18 |
1 files changed, 2 insertions, 16 deletions
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 |