From: simonmar Date: Thu, 2 Jun 2005 08:51:17 +0000 (+0000) Subject: [project @ 2005-06-02 08:51:17 by simonmar] X-Git-Tag: Initial_conversion_from_CVS_complete~463 X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=commitdiff_plain;h=6772ff17eb27682de79f41ee6f3b9865eb898b53 [project @ 2005-06-02 08:51:17 by simonmar] Make GHC.depanal store the module graph in the session again. Fixes ghc -M. --- 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