Allocate HIR Forest on arena.

This commit is contained in:
Camille GILLOT 2019-11-27 13:32:28 +01:00
parent e321ba989c
commit 1e12f39d83
2 changed files with 2 additions and 3 deletions

View File

@ -93,6 +93,7 @@ macro_rules! arena_types {
rustc::hir::def_id::CrateNum
>
>,
[few] hir_forest: rustc::hir::map::Forest,
[few] diagnostic_items: rustc_data_structures::fx::FxHashMap<
syntax::symbol::Symbol,
rustc::hir::def_id::DefId,

View File

@ -72,7 +72,6 @@ fn default() -> Self {
pub struct Queries<'tcx> {
compiler: &'tcx Compiler,
gcx: Once<GlobalCtxt<'tcx>>,
forest: Once<hir::map::Forest>,
all_arenas: AllArenas,
arena: WorkerLocal<Arena<'tcx>>,
@ -94,7 +93,6 @@ pub fn new(compiler: &'tcx Compiler) -> Queries<'tcx> {
Queries {
compiler,
gcx: Once::new(),
forest: Once::new(),
all_arenas: AllArenas::new(),
arena: WorkerLocal::new(|_| Arena::default()),
dep_graph_future: Default::default(),
@ -236,7 +234,7 @@ pub fn lower_to_hir(
&krate
)
})?;
let hir = self.forest.init_locking(|| hir);
let hir = self.arena.alloc(hir);
Ok((hir, Steal::new(BoxedResolver::to_resolver_outputs(resolver))))
})
}