@@ -138,6 +138,19 @@ pub fn compile_input(sess: &Session,
138
138
& id) ,
139
139
Ok ( ( ) ) ) ;
140
140
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
+
141
154
let expanded_crate = assign_node_ids ( sess, expanded_crate) ;
142
155
let dep_graph = DepGraph :: new ( sess. opts . build_dep_graph ( ) ) ;
143
156
@@ -173,25 +186,22 @@ pub fn compile_input(sess: &Session,
173
186
"indexing hir" ,
174
187
move || hir_map:: map_crate ( hir_forest, defs) ) ;
175
188
176
-
177
- write_out_deps ( sess, & outputs, & id) ;
178
-
179
189
{
180
190
let _ignore = hir_map. dep_graph . in_ignore ( ) ;
181
- controller_entry_point ! ( after_write_deps ,
191
+ controller_entry_point ! ( after_hir_lowering ,
182
192
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) ,
195
205
Ok ( ( ) ) ) ;
196
206
}
197
207
@@ -311,6 +321,7 @@ pub struct CompileController<'a> {
311
321
pub after_parse : PhaseController < ' a > ,
312
322
pub after_expand : PhaseController < ' a > ,
313
323
pub after_write_deps : PhaseController < ' a > ,
324
+ pub after_hir_lowering : PhaseController < ' a > ,
314
325
pub after_analysis : PhaseController < ' a > ,
315
326
pub after_llvm : PhaseController < ' a > ,
316
327
@@ -323,6 +334,7 @@ impl<'a> CompileController<'a> {
323
334
after_parse : PhaseController :: basic ( ) ,
324
335
after_expand : PhaseController :: basic ( ) ,
325
336
after_write_deps : PhaseController :: basic ( ) ,
337
+ after_hir_lowering : PhaseController :: basic ( ) ,
326
338
after_analysis : PhaseController :: basic ( ) ,
327
339
after_llvm : PhaseController :: basic ( ) ,
328
340
make_glob_map : resolve:: MakeGlobMap :: No ,
@@ -433,15 +445,32 @@ impl<'a, 'b, 'ast, 'tcx> CompileState<'a, 'b, 'ast, 'tcx> {
433
445
session : & ' ast Session ,
434
446
out_dir : & ' a Option < PathBuf > ,
435
447
out_file : & ' a Option < PathBuf > ,
436
- arenas : & ' ast ty:: CtxtArenas < ' ast > ,
437
448
cstore : & ' a CStore ,
438
- hir_map : & ' a hir_map:: Map < ' ast > ,
439
- analysis : & ' a ty:: CrateAnalysis ,
440
- resolutions : & ' a Resolutions ,
441
449
krate : & ' a ast:: Crate ,
442
- hir_crate : & ' a hir:: Crate ,
443
450
crate_name : & ' a str )
444
451
-> 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 > {
445
474
CompileState {
446
475
crate_name : Some ( crate_name) ,
447
476
arenas : Some ( arenas) ,
0 commit comments