From 6772ff17eb27682de79f41ee6f3b9865eb898b53 Mon Sep 17 00:00:00 2001 From: simonmar Date: Thu, 2 Jun 2005 08:51:17 +0000 Subject: [PATCH] [project @ 2005-06-02 08:51:17 by simonmar] Make GHC.depanal store the module graph in the session again. Fixes ghc -M. --- ghc/compiler/main/GHC.hs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/ghc/compiler/main/GHC.hs b/ghc/compiler/main/GHC.hs index 65a295e..192bfbf 100644 --- a/ghc/compiler/main/GHC.hs +++ b/ghc/compiler/main/GHC.hs @@ -401,7 +401,11 @@ depanal (Session ref) excluded_mods = do text "Chasing modules from: ", hcat (punctuate comma (map pprTarget targets))])) - downsweep hsc_env old_graph excluded_mods + r <- downsweep hsc_env old_graph excluded_mods + case r of + Right mod_graph -> writeIORef ref hsc_env{ hsc_mod_graph = mod_graph } + _ -> return () + return r {- -- | The result of load. @@ -442,11 +446,8 @@ loadMsgs s@(Session ref) how_much msg_act -- were successfully loaded by inspecting the Session's HPT. mb_graph <- depanal s [] case mb_graph of - Left msgs -> do msg_act msgs; return Failed - Right mod_graph -> do - hsc_env <- readIORef ref - writeIORef ref hsc_env{ hsc_mod_graph = mod_graph } - loadMsgs2 s how_much msg_act mod_graph + Left msgs -> do msg_act msgs; return Failed + Right mod_graph -> loadMsgs2 s how_much msg_act mod_graph loadMsgs2 s@(Session ref) how_much msg_act mod_graph = do hsc_env <- readIORef ref -- 1.7.10.4