From 1e12f39d83eeddd523e384e20ab4f1fa56eb8888 Mon Sep 17 00:00:00 2001 From: Camille GILLOT Date: Wed, 27 Nov 2019 13:32:28 +0100 Subject: [PATCH] Allocate HIR Forest on arena. --- src/librustc/arena.rs | 1 + src/librustc_interface/queries.rs | 4 +--- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/librustc/arena.rs b/src/librustc/arena.rs index 9b13a910c617..193b04eabb3f 100644 --- a/src/librustc/arena.rs +++ b/src/librustc/arena.rs @@ -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, diff --git a/src/librustc_interface/queries.rs b/src/librustc_interface/queries.rs index 53ab5eb990dd..6103d42c5dbc 100644 --- a/src/librustc_interface/queries.rs +++ b/src/librustc_interface/queries.rs @@ -72,7 +72,6 @@ impl Default for Query { pub struct Queries<'tcx> { compiler: &'tcx Compiler, gcx: Once>, - forest: Once, all_arenas: AllArenas, arena: WorkerLocal>, @@ -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(), @@ -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)))) }) }