@@ -138,6 +138,20 @@ pub fn compile_input(sess: &Session,
138138 & id) ,
139139 Ok ( ( ) ) ) ;
140140
141+ write_out_deps ( sess, & outputs, & id) ;
142+
143+ { controller_entry_point ! ( after_write_deps,
144+ sess,
145+ CompileState :: state_after_write_deps( input,
146+ sess,
147+ outdir,
148+ output,
149+ & cstore,
150+ & expanded_crate,
151+ & id) ,
152+ Ok ( ( ) ) ) ;
153+ }
154+
141155 let expanded_crate = assign_node_ids ( sess, expanded_crate) ;
142156 let dep_graph = DepGraph :: new ( sess. opts . build_dep_graph ( ) ) ;
143157
@@ -173,25 +187,22 @@ pub fn compile_input(sess: &Session,
173187 "indexing hir" ,
174188 move || hir_map:: map_crate ( hir_forest, defs) ) ;
175189
176-
177- write_out_deps ( sess, & outputs, & id) ;
178-
179190 {
180191 let _ignore = hir_map. dep_graph . in_ignore ( ) ;
181- controller_entry_point ! ( after_write_deps ,
192+ controller_entry_point ! ( after_ast ,
182193 sess,
183- CompileState :: state_after_write_deps ( input,
184- sess,
185- outdir,
186- output,
187- & arenas,
188- & cstore,
189- & hir_map,
190- & analysis,
191- & resolutions,
192- & expanded_crate,
193- & hir_map. krate( ) ,
194- & id) ,
194+ CompileState :: state_after_ast ( input,
195+ sess,
196+ outdir,
197+ output,
198+ & arenas,
199+ & cstore,
200+ & hir_map,
201+ & analysis,
202+ & resolutions,
203+ & expanded_crate,
204+ & hir_map. krate( ) ,
205+ & id) ,
195206 Ok ( ( ) ) ) ;
196207 }
197208
@@ -311,6 +322,7 @@ pub struct CompileController<'a> {
311322 pub after_parse : PhaseController < ' a > ,
312323 pub after_expand : PhaseController < ' a > ,
313324 pub after_write_deps : PhaseController < ' a > ,
325+ pub after_ast : PhaseController < ' a > ,
314326 pub after_analysis : PhaseController < ' a > ,
315327 pub after_llvm : PhaseController < ' a > ,
316328
@@ -323,6 +335,7 @@ impl<'a> CompileController<'a> {
323335 after_parse : PhaseController :: basic ( ) ,
324336 after_expand : PhaseController :: basic ( ) ,
325337 after_write_deps : PhaseController :: basic ( ) ,
338+ after_ast : PhaseController :: basic ( ) ,
326339 after_analysis : PhaseController :: basic ( ) ,
327340 after_llvm : PhaseController :: basic ( ) ,
328341 make_glob_map : resolve:: MakeGlobMap :: No ,
@@ -430,6 +443,23 @@ impl<'a, 'b, 'ast, 'tcx> CompileState<'a, 'b, 'ast, 'tcx> {
430443 }
431444
432445 fn state_after_write_deps ( input : & ' a Input ,
446+ session : & ' ast Session ,
447+ out_dir : & ' a Option < PathBuf > ,
448+ out_file : & ' a Option < PathBuf > ,
449+ cstore : & ' a CStore ,
450+ krate : & ' a ast:: Crate ,
451+ crate_name : & ' a str )
452+ -> CompileState < ' a , ' b , ' ast , ' tcx > {
453+ CompileState {
454+ crate_name : Some ( crate_name) ,
455+ cstore : Some ( cstore) ,
456+ expanded_crate : Some ( krate) ,
457+ out_file : out_file. as_ref ( ) . map ( |s| & * * s) ,
458+ ..CompileState :: empty ( input, session, out_dir)
459+ }
460+ }
461+
462+ fn state_after_ast ( input : & ' a Input ,
433463 session : & ' ast Session ,
434464 out_dir : & ' a Option < PathBuf > ,
435465 out_file : & ' a Option < PathBuf > ,
0 commit comments