@@ -138,6 +138,19 @@ 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+
141154 let expanded_crate = assign_node_ids ( sess, expanded_crate) ;
142155 let dep_graph = DepGraph :: new ( sess. opts . build_dep_graph ( ) ) ;
143156
@@ -173,25 +186,22 @@ pub fn compile_input(sess: &Session,
173186 "indexing hir" ,
174187 move || hir_map:: map_crate ( hir_forest, defs) ) ;
175188
176-
177- write_out_deps ( sess, & outputs, & id) ;
178-
179189 {
180190 let _ignore = hir_map. dep_graph . in_ignore ( ) ;
181- controller_entry_point ! ( after_write_deps ,
191+ controller_entry_point ! ( after_hir_lowering ,
182192 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) ,
193+ CompileState :: state_after_hir_lowering ( input,
194+ sess,
195+ outdir,
196+ output,
197+ & arenas,
198+ & cstore,
199+ & hir_map,
200+ & analysis,
201+ & resolutions,
202+ & expanded_crate,
203+ & hir_map. krate( ) ,
204+ & id) ,
195205 Ok ( ( ) ) ) ;
196206 }
197207
@@ -311,6 +321,7 @@ pub struct CompileController<'a> {
311321 pub after_parse : PhaseController < ' a > ,
312322 pub after_expand : PhaseController < ' a > ,
313323 pub after_write_deps : PhaseController < ' a > ,
324+ pub after_hir_lowering : PhaseController < ' a > ,
314325 pub after_analysis : PhaseController < ' a > ,
315326 pub after_llvm : PhaseController < ' a > ,
316327
@@ -323,6 +334,7 @@ impl<'a> CompileController<'a> {
323334 after_parse : PhaseController :: basic ( ) ,
324335 after_expand : PhaseController :: basic ( ) ,
325336 after_write_deps : PhaseController :: basic ( ) ,
337+ after_hir_lowering : PhaseController :: basic ( ) ,
326338 after_analysis : PhaseController :: basic ( ) ,
327339 after_llvm : PhaseController :: basic ( ) ,
328340 make_glob_map : resolve:: MakeGlobMap :: No ,
@@ -433,15 +445,32 @@ impl<'a, 'b, 'ast, 'tcx> CompileState<'a, 'b, 'ast, 'tcx> {
433445 session : & ' ast Session ,
434446 out_dir : & ' a Option < PathBuf > ,
435447 out_file : & ' a Option < PathBuf > ,
436- arenas : & ' ast ty:: CtxtArenas < ' ast > ,
437448 cstore : & ' a CStore ,
438- hir_map : & ' a hir_map:: Map < ' ast > ,
439- analysis : & ' a ty:: CrateAnalysis ,
440- resolutions : & ' a Resolutions ,
441449 krate : & ' a ast:: Crate ,
442- hir_crate : & ' a hir:: Crate ,
443450 crate_name : & ' a str )
444451 -> CompileState < ' a , ' b , ' ast , ' tcx > {
452+ CompileState {
453+ crate_name : Some ( crate_name) ,
454+ cstore : Some ( cstore) ,
455+ expanded_crate : Some ( krate) ,
456+ out_file : out_file. as_ref ( ) . map ( |s| & * * s) ,
457+ ..CompileState :: empty ( input, session, out_dir)
458+ }
459+ }
460+
461+ fn state_after_hir_lowering ( input : & ' a Input ,
462+ session : & ' ast Session ,
463+ out_dir : & ' a Option < PathBuf > ,
464+ out_file : & ' a Option < PathBuf > ,
465+ arenas : & ' ast ty:: CtxtArenas < ' ast > ,
466+ cstore : & ' a CStore ,
467+ hir_map : & ' a hir_map:: Map < ' ast > ,
468+ analysis : & ' a ty:: CrateAnalysis ,
469+ resolutions : & ' a Resolutions ,
470+ krate : & ' a ast:: Crate ,
471+ hir_crate : & ' a hir:: Crate ,
472+ crate_name : & ' a str )
473+ -> CompileState < ' a , ' b , ' ast , ' tcx > {
445474 CompileState {
446475 crate_name : Some ( crate_name) ,
447476 arenas : Some ( arenas) ,
0 commit comments