Skip to content

Commit

Permalink
Simplify handling of AllArenas.
Browse files Browse the repository at this point in the history
  • Loading branch information
cjgillot committed Nov 27, 2019
1 parent e5ed101 commit 77a4c85
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
5 changes: 2 additions & 3 deletions src/librustc_interface/passes.rs
Expand Up @@ -764,7 +764,7 @@ pub fn create_global_ctxt<'tcx>(
outputs: OutputFilenames,
crate_name: &str,
global_ctxt: &'tcx Once<GlobalCtxt<'tcx>>,
arenas: &'tcx Once<AllArenas>,
all_arenas: &'tcx AllArenas,
local_arena: &'tcx WorkerLocal<Arena<'tcx>>,
) -> QueryContext<'tcx> {
let sess = &compiler.session();
Expand Down Expand Up @@ -793,13 +793,12 @@ pub fn create_global_ctxt<'tcx>(
callback(sess, &mut local_providers, &mut extern_providers);
}

let arenas = arenas.init_locking(|| AllArenas::new());
let gcx = global_ctxt.init_locking(|| TyCtxt::create_global_ctxt(
sess,
lint_store,
local_providers,
extern_providers,
&arenas,
&all_arenas,
local_arena,
resolver_outputs,
hir_map,
Expand Down
6 changes: 3 additions & 3 deletions src/librustc_interface/queries.rs
Expand Up @@ -72,9 +72,9 @@ impl<T> Default for Query<T> {
pub struct Queries<'tcx> {
compiler: &'tcx Compiler,
gcx: Once<GlobalCtxt<'tcx>>,
arenas: Once<AllArenas>,
forest: Once<hir::map::Forest>,

all_arenas: AllArenas,
local_arena: WorkerLocal<Arena<'tcx>>,

dep_graph_future: Query<Option<DepGraphFuture>>,
Expand All @@ -94,8 +94,8 @@ impl<'tcx> Queries<'tcx> {
Queries {
compiler,
gcx: Once::new(),
arenas: Once::new(),
forest: Once::new(),
all_arenas: AllArenas::new(),
local_arena: WorkerLocal::new(|_| Arena::default()),
dep_graph_future: Default::default(),
parse: Default::default(),
Expand Down Expand Up @@ -268,7 +268,7 @@ impl<'tcx> Queries<'tcx> {
outputs,
&crate_name,
&self.gcx,
&self.arenas,
&self.all_arenas,
&self.local_arena,
))
})
Expand Down

0 comments on commit 77a4c85

Please sign in to comment.