Skip to content

Commit 93a6559

Browse files
ast_map => hir_map
1 parent 4ce1daf commit 93a6559

File tree

1 file changed

+20
-22
lines changed

1 file changed

+20
-22
lines changed

src/librustc_driver/driver.rs

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ pub fn compile_input(sess: Session,
121121
}
122122

123123
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);
125125

126126
write_out_deps(&sess, &outputs, &id);
127127

@@ -130,9 +130,9 @@ pub fn compile_input(sess: Session,
130130
CompileState::state_after_write_deps(input,
131131
&sess,
132132
outdir,
133-
&ast_map,
133+
&hir_map,
134134
&expanded_crate,
135-
&ast_map.krate(),
135+
&hir_map.krate(),
136136
&id[..],
137137
&lcx));
138138

@@ -146,7 +146,7 @@ pub fn compile_input(sess: Session,
146146

147147
phase_3_run_analysis_passes(&sess,
148148
&cstore,
149-
ast_map,
149+
hir_map,
150150
&arenas,
151151
&id,
152152
control.make_glob_map,
@@ -341,15 +341,15 @@ impl<'a, 'ast, 'tcx> CompileState<'a, 'ast, 'tcx> {
341341
fn state_after_write_deps(input: &'a Input,
342342
session: &'a Session,
343343
out_dir: &'a Option<PathBuf>,
344-
ast_map: &'a hir_map::Map<'ast>,
344+
hir_map: &'a hir_map::Map<'ast>,
345345
krate: &'a ast::Crate,
346346
hir_crate: &'a hir::Crate,
347347
crate_name: &'a str,
348348
lcx: &'a LoweringContext<'a>)
349349
-> CompileState<'a, 'ast, 'tcx> {
350350
CompileState {
351351
crate_name: Some(crate_name),
352-
ast_map: Some(ast_map),
352+
ast_map: Some(hir_map),
353353
krate: Some(krate),
354354
hir_crate: Some(hir_crate),
355355
lcx: Some(lcx),
@@ -670,22 +670,20 @@ pub fn assign_node_ids(sess: &Session, krate: ast::Crate) -> ast::Crate {
670670
}
671671

672672
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))
681679
}
682680

683681
/// Run the resolution, typechecking, region checking and other
684682
/// miscellaneous analysis passes on the crate. Return various
685683
/// structures carrying the results of the analysis.
686684
pub fn phase_3_run_analysis_passes<'tcx, F, R>(sess: &'tcx Session,
687685
cstore: &CStore,
688-
ast_map: front::map::Map<'tcx>,
686+
hir_map: hir_map::Map<'tcx>,
689687
arenas: &'tcx ty::CtxtArenas<'tcx>,
690688
name: &str,
691689
make_glob_map: resolve::MakeGlobMap,
@@ -694,15 +692,15 @@ pub fn phase_3_run_analysis_passes<'tcx, F, R>(sess: &'tcx Session,
694692
where F: for<'a> FnOnce(&'a ty::ctxt<'tcx>, MirMap<'tcx>, ty::CrateAnalysis) -> R
695693
{
696694
let time_passes = sess.time_passes();
697-
let krate = ast_map.krate();
695+
let krate = hir_map.krate();
698696

699697
time(time_passes,
700698
"external crate/lib resolution",
701-
|| LocalCrateReader::new(sess, cstore, &ast_map).read_crates(krate));
699+
|| LocalCrateReader::new(sess, cstore, &hir_map).read_crates(krate));
702700

703701
let lang_items = time(time_passes,
704702
"language item collection",
705-
|| middle::lang_items::collect_language_items(&sess, &ast_map));
703+
|| middle::lang_items::collect_language_items(&sess, &hir_map));
706704

707705
let resolve::CrateMap {
708706
def_map,
@@ -713,15 +711,15 @@ pub fn phase_3_run_analysis_passes<'tcx, F, R>(sess: &'tcx Session,
713711
glob_map,
714712
} = time(time_passes,
715713
"resolution",
716-
|| resolve::resolve_crate(sess, &ast_map, make_glob_map));
714+
|| resolve::resolve_crate(sess, &hir_map, make_glob_map));
717715

718716
let named_region_map = time(time_passes,
719717
"lifetime resolution",
720718
|| middle::resolve_lifetime::krate(sess, krate, &def_map.borrow()));
721719

722720
time(time_passes,
723721
"looking for entry point",
724-
|| middle::entry::find_entry_point(sess, &ast_map));
722+
|| middle::entry::find_entry_point(sess, &hir_map));
725723

726724
sess.plugin_registrar_fn.set(time(time_passes, "looking for plugin registrar", || {
727725
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,
737735

738736
time(time_passes,
739737
"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));
741739

742740
ty::ctxt::create_and_enter(sess,
743741
arenas,
744742
def_map,
745743
named_region_map,
746-
ast_map,
744+
hir_map,
747745
freevars,
748746
region_map,
749747
lang_items,

0 commit comments

Comments
 (0)