diff options
author | Edward Z. Yang <ezyang@cs.stanford.edu> | 2016-10-06 13:40:10 -0700 |
---|---|---|
committer | Edward Z. Yang <ezyang@cs.stanford.edu> | 2016-10-08 01:37:56 -0700 |
commit | 5bd8e8d30c046187f2804db3af1768ea8b07dc41 (patch) | |
tree | ecea3d97b4599e19893ff8b9ca6da3c51066b27b /compiler/iface/LoadIface.hs | |
parent | 4e8a0607140b23561248a41aeaf837224aa6315b (diff) | |
download | haskell-5bd8e8d30c046187f2804db3af1768ea8b07dc41.tar.gz |
Make InstalledUnitId be ONLY a FastString.
It turns out that we don't really need to be able to
extract a ComponentId from UnitId, except in one case.
So compress UnitId into a single FastString.
The one case where we do need the ComponentId is when
we are compiling an instantiated version of a package;
we need the ComponentId to look up the indefinite
version of this package from the database. So now we
just pass it in as an argument -this-component-id.
Also: ghc-pkg now no longer will unregister a package if
you register one with the same package name, if the
instantiations don't match.
Cabal submodule update which tracks the same data type
change.
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Diffstat (limited to 'compiler/iface/LoadIface.hs')
-rw-r--r-- | compiler/iface/LoadIface.hs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/compiler/iface/LoadIface.hs b/compiler/iface/LoadIface.hs index ca11c6f59b..6005ba5053 100644 --- a/compiler/iface/LoadIface.hs +++ b/compiler/iface/LoadIface.hs @@ -533,12 +533,12 @@ computeInterface doc_str hi_boot_file mod0 = do MASSERT( not (isHoleModule mod0) ) dflags <- getDynFlags case splitModuleInsts mod0 of - (imod, Just insts) | not (unitIdIsDefinite (thisPackage dflags)) -> do + (imod, Just indef) | not (unitIdIsDefinite (thisPackage dflags)) -> do r <- findAndReadIface doc_str imod hi_boot_file case r of Succeeded (iface0, path) -> do hsc_env <- getTopEnv - r <- liftIO (rnModIface hsc_env insts Nothing iface0) + r <- liftIO (rnModIface hsc_env (indefUnitIdInsts (indefModuleUnitId indef)) Nothing iface0) return (Succeeded (r, path)) Failed err -> return (Failed err) (mod, _) -> @@ -560,7 +560,8 @@ moduleFreeHolesPrecise doc_str mod | moduleIsDefinite mod = return (Succeeded emptyUniqDSet) | otherwise = case splitModuleInsts mod of - (imod, Just insts) -> do + (imod, Just indef) -> do + let insts = indefUnitIdInsts (indefModuleUnitId indef) traceIf (text "Considering whether to load" <+> ppr mod <+> text "to compute precise free module holes") (eps, hpt) <- getEpsAndHpt |