diff options
Diffstat (limited to 'ghc/GHCi/UI.hs')
-rw-r--r-- | ghc/GHCi/UI.hs | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/ghc/GHCi/UI.hs b/ghc/GHCi/UI.hs index 152017de38..4a1b91a9fc 100644 --- a/ghc/GHCi/UI.hs +++ b/ghc/GHCi/UI.hs @@ -76,6 +76,7 @@ import qualified GHC.Parser.Lexer as Lexer import GHC.Unit import GHC.Unit.State import GHC.Unit.Finder as Finder +import GHC.Unit.Module.Graph (filterToposortToModules) import GHC.Unit.Module.ModSummary import GHC.Data.StringBuffer @@ -1632,8 +1633,9 @@ chooseEditFile = graph <- GHC.getModuleGraph failed_graph <- - GHC.mkModuleGraph <$> filterM hasFailed (GHC.mgModSummaries graph) - let order g = flattenSCCs $ GHC.topSortModuleGraph True g Nothing + GHC.mkModuleGraph . fmap extendModSummaryNoDeps <$> filterM hasFailed (GHC.mgModSummaries graph) + let order g = flattenSCCs $ filterToposortToModules $ + GHC.topSortModuleGraph True g Nothing pick xs = case xs of x : _ -> GHC.ml_hs_file (GHC.ms_location x) _ -> Nothing @@ -2018,8 +2020,9 @@ setContextAfterLoad keep_ctxt ms = do targets <- GHC.getTargets case [ m | Just m <- map (findTarget ms) targets ] of [] -> - let graph = GHC.mkModuleGraph ms - graph' = flattenSCCs (GHC.topSortModuleGraph True graph Nothing) + let graph = GHC.mkModuleGraph $ extendModSummaryNoDeps <$> ms + graph' = flattenSCCs $ filterToposortToModules $ + GHC.topSortModuleGraph True graph Nothing in load_this (last graph') (m:_) -> load_this m |