Skip to content

Commit

Permalink
Allocate HIR Forest on arena.
Browse files Browse the repository at this point in the history
  • Loading branch information
cjgillot committed Nov 27, 2019
1 parent e321ba9 commit 1e12f39
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/librustc/arena.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 1 addition & 3 deletions src/librustc_interface/queries.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ impl<T> Default for Query<T> {
pub struct Queries<'tcx> {
compiler: &'tcx Compiler,
gcx: Once<GlobalCtxt<'tcx>>,
forest: Once<hir::map::Forest>,

all_arenas: AllArenas,
arena: WorkerLocal<Arena<'tcx>>,
Expand All @@ -94,7 +93,6 @@ impl<'tcx> Queries<'tcx> {
Queries {
compiler,
gcx: Once::new(),
forest: Once::new(),
all_arenas: AllArenas::new(),
arena: WorkerLocal::new(|_| Arena::default()),
dep_graph_future: Default::default(),
Expand Down Expand Up @@ -236,7 +234,7 @@ impl<'tcx> Queries<'tcx> {
&krate
)
})?;
let hir = self.forest.init_locking(|| hir);
let hir = self.arena.alloc(hir);
Ok((hir, Steal::new(BoxedResolver::to_resolver_outputs(resolver))))
})
}
Expand Down

0 comments on commit 1e12f39

Please sign in to comment.