Skip to content

Commit 107ea5d

Browse files
Move WorkerLocal out of QueryArenas
This cuts librustc_driver.so code size by ~85 kilobytes.
1 parent ee9223f commit 107ea5d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

compiler/rustc_middle/src/query/mod.rs

-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ use rustc_data_structures::fx::{FxHashMap, FxIndexMap, FxIndexSet};
6161
use rustc_data_structures::steal::Steal;
6262
use rustc_data_structures::svh::Svh;
6363
use rustc_data_structures::sync::Lrc;
64-
use rustc_data_structures::sync::WorkerLocal;
6564
use rustc_data_structures::unord::UnordSet;
6665
use rustc_errors::ErrorGuaranteed;
6766
use rustc_hir as hir;

compiler/rustc_middle/src/query/plumbing.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ use field_offset::FieldOffset;
1111
use measureme::StringId;
1212
use rustc_data_structures::fx::FxHashMap;
1313
use rustc_data_structures::sync::AtomicU64;
14+
use rustc_data_structures::sync::WorkerLocal;
1415
use rustc_hir::def::DefKind;
1516
use rustc_hir::def_id::{DefId, LocalDefId};
1617
use rustc_hir::hir_id::OwnerId;
@@ -71,7 +72,7 @@ pub struct QuerySystemFns<'tcx> {
7172

7273
pub struct QuerySystem<'tcx> {
7374
pub states: QueryStates<'tcx>,
74-
pub arenas: QueryArenas<'tcx>,
75+
pub arenas: WorkerLocal<QueryArenas<'tcx>>,
7576
pub caches: QueryCaches<'tcx>,
7677
pub dynamic_queries: DynamicQueries<'tcx>,
7778

@@ -370,7 +371,7 @@ macro_rules! define_callbacks {
370371

371372
pub struct QueryArenas<'tcx> {
372373
$($(#[$attr])* pub $name: query_if_arena!([$($modifiers)*]
373-
(WorkerLocal<TypedArena<<$V as Deref>::Target>>)
374+
(TypedArena<<$V as Deref>::Target>)
374375
()
375376
),)*
376377
}
@@ -379,7 +380,7 @@ macro_rules! define_callbacks {
379380
fn default() -> Self {
380381
Self {
381382
$($name: query_if_arena!([$($modifiers)*]
382-
(WorkerLocal::new(|_| Default::default()))
383+
(Default::default())
383384
()
384385
),)*
385386
}

0 commit comments

Comments
 (0)