@@ -121,7 +121,7 @@ pub fn compile_input(sess: Session,
121
121
}
122
122
123
123
let arenas = ty:: CtxtArenas :: new ( ) ;
124
- let ast_map = make_map ( & sess, & mut hir_forest) ;
124
+ let hir_map = make_map ( & sess, & mut hir_forest) ;
125
125
126
126
write_out_deps ( & sess, & outputs, & id) ;
127
127
@@ -130,9 +130,9 @@ pub fn compile_input(sess: Session,
130
130
CompileState :: state_after_write_deps( input,
131
131
& sess,
132
132
outdir,
133
- & ast_map ,
133
+ & hir_map ,
134
134
& expanded_crate,
135
- & ast_map . krate( ) ,
135
+ & hir_map . krate( ) ,
136
136
& id[ ..] ,
137
137
& lcx) ) ;
138
138
@@ -146,7 +146,7 @@ pub fn compile_input(sess: Session,
146
146
147
147
phase_3_run_analysis_passes ( & sess,
148
148
& cstore,
149
- ast_map ,
149
+ hir_map ,
150
150
& arenas,
151
151
& id,
152
152
control. make_glob_map ,
@@ -341,15 +341,15 @@ impl<'a, 'ast, 'tcx> CompileState<'a, 'ast, 'tcx> {
341
341
fn state_after_write_deps ( input : & ' a Input ,
342
342
session : & ' a Session ,
343
343
out_dir : & ' a Option < PathBuf > ,
344
- ast_map : & ' a hir_map:: Map < ' ast > ,
344
+ hir_map : & ' a hir_map:: Map < ' ast > ,
345
345
krate : & ' a ast:: Crate ,
346
346
hir_crate : & ' a hir:: Crate ,
347
347
crate_name : & ' a str ,
348
348
lcx : & ' a LoweringContext < ' a > )
349
349
-> CompileState < ' a , ' ast , ' tcx > {
350
350
CompileState {
351
351
crate_name : Some ( crate_name) ,
352
- ast_map : Some ( ast_map ) ,
352
+ ast_map : Some ( hir_map ) ,
353
353
krate : Some ( krate) ,
354
354
hir_crate : Some ( hir_crate) ,
355
355
lcx : Some ( lcx) ,
@@ -670,22 +670,20 @@ pub fn assign_node_ids(sess: &Session, krate: ast::Crate) -> ast::Crate {
670
670
}
671
671
672
672
pub fn make_map < ' ast > ( sess : & Session ,
673
- forest : & ' ast mut front:: map:: Forest )
674
- -> front:: map:: Map < ' ast > {
675
- // Construct the 'ast'-map
676
- let map = time ( sess. time_passes ( ) ,
677
- "indexing hir" ,
678
- move || front:: map:: map_crate ( forest) ) ;
679
-
680
- map
673
+ forest : & ' ast mut hir_map:: Forest )
674
+ -> hir_map:: Map < ' ast > {
675
+ // Construct the HIR map
676
+ time ( sess. time_passes ( ) ,
677
+ "indexing hir" ,
678
+ move || hir_map:: map_crate ( forest) )
681
679
}
682
680
683
681
/// Run the resolution, typechecking, region checking and other
684
682
/// miscellaneous analysis passes on the crate. Return various
685
683
/// structures carrying the results of the analysis.
686
684
pub fn phase_3_run_analysis_passes < ' tcx , F , R > ( sess : & ' tcx Session ,
687
685
cstore : & CStore ,
688
- ast_map : front :: map :: Map < ' tcx > ,
686
+ hir_map : hir_map :: Map < ' tcx > ,
689
687
arenas : & ' tcx ty:: CtxtArenas < ' tcx > ,
690
688
name : & str ,
691
689
make_glob_map : resolve:: MakeGlobMap ,
@@ -694,15 +692,15 @@ pub fn phase_3_run_analysis_passes<'tcx, F, R>(sess: &'tcx Session,
694
692
where F : for < ' a > FnOnce ( & ' a ty:: ctxt < ' tcx > , MirMap < ' tcx > , ty:: CrateAnalysis ) -> R
695
693
{
696
694
let time_passes = sess. time_passes ( ) ;
697
- let krate = ast_map . krate ( ) ;
695
+ let krate = hir_map . krate ( ) ;
698
696
699
697
time ( time_passes,
700
698
"external crate/lib resolution" ,
701
- || LocalCrateReader :: new ( sess, cstore, & ast_map ) . read_crates ( krate) ) ;
699
+ || LocalCrateReader :: new ( sess, cstore, & hir_map ) . read_crates ( krate) ) ;
702
700
703
701
let lang_items = time ( time_passes,
704
702
"language item collection" ,
705
- || middle:: lang_items:: collect_language_items ( & sess, & ast_map ) ) ;
703
+ || middle:: lang_items:: collect_language_items ( & sess, & hir_map ) ) ;
706
704
707
705
let resolve:: CrateMap {
708
706
def_map,
@@ -713,15 +711,15 @@ pub fn phase_3_run_analysis_passes<'tcx, F, R>(sess: &'tcx Session,
713
711
glob_map,
714
712
} = time ( time_passes,
715
713
"resolution" ,
716
- || resolve:: resolve_crate ( sess, & ast_map , make_glob_map) ) ;
714
+ || resolve:: resolve_crate ( sess, & hir_map , make_glob_map) ) ;
717
715
718
716
let named_region_map = time ( time_passes,
719
717
"lifetime resolution" ,
720
718
|| middle:: resolve_lifetime:: krate ( sess, krate, & def_map. borrow ( ) ) ) ;
721
719
722
720
time ( time_passes,
723
721
"looking for entry point" ,
724
- || middle:: entry:: find_entry_point ( sess, & ast_map ) ) ;
722
+ || middle:: entry:: find_entry_point ( sess, & hir_map ) ) ;
725
723
726
724
sess. plugin_registrar_fn . set ( time ( time_passes, "looking for plugin registrar" , || {
727
725
plugin:: build:: find_plugin_registrar ( sess. diagnostic ( ) , krate)
@@ -737,13 +735,13 @@ pub fn phase_3_run_analysis_passes<'tcx, F, R>(sess: &'tcx Session,
737
735
738
736
time ( time_passes,
739
737
"static item recursion checking" ,
740
- || middle:: check_static_recursion:: check_crate ( sess, krate, & def_map. borrow ( ) , & ast_map ) ) ;
738
+ || middle:: check_static_recursion:: check_crate ( sess, krate, & def_map. borrow ( ) , & hir_map ) ) ;
741
739
742
740
ty:: ctxt:: create_and_enter ( sess,
743
741
arenas,
744
742
def_map,
745
743
named_region_map,
746
- ast_map ,
744
+ hir_map ,
747
745
freevars,
748
746
region_map,
749
747
lang_items,
0 commit comments