Move WorkerLocal out of QueryArenas
This cuts librustc_driver.so code size by ~85 kilobytes.
This commit is contained in:
parent
ee9223ff97
commit
107ea5d3bc
@ -61,7 +61,6 @@ use rustc_data_structures::fx::{FxHashMap, FxIndexMap, FxIndexSet};
|
|||||||
use rustc_data_structures::steal::Steal;
|
use rustc_data_structures::steal::Steal;
|
||||||
use rustc_data_structures::svh::Svh;
|
use rustc_data_structures::svh::Svh;
|
||||||
use rustc_data_structures::sync::Lrc;
|
use rustc_data_structures::sync::Lrc;
|
||||||
use rustc_data_structures::sync::WorkerLocal;
|
|
||||||
use rustc_data_structures::unord::UnordSet;
|
use rustc_data_structures::unord::UnordSet;
|
||||||
use rustc_errors::ErrorGuaranteed;
|
use rustc_errors::ErrorGuaranteed;
|
||||||
use rustc_hir as hir;
|
use rustc_hir as hir;
|
||||||
|
@ -11,6 +11,7 @@ use field_offset::FieldOffset;
|
|||||||
use measureme::StringId;
|
use measureme::StringId;
|
||||||
use rustc_data_structures::fx::FxHashMap;
|
use rustc_data_structures::fx::FxHashMap;
|
||||||
use rustc_data_structures::sync::AtomicU64;
|
use rustc_data_structures::sync::AtomicU64;
|
||||||
|
use rustc_data_structures::sync::WorkerLocal;
|
||||||
use rustc_hir::def::DefKind;
|
use rustc_hir::def::DefKind;
|
||||||
use rustc_hir::def_id::{DefId, LocalDefId};
|
use rustc_hir::def_id::{DefId, LocalDefId};
|
||||||
use rustc_hir::hir_id::OwnerId;
|
use rustc_hir::hir_id::OwnerId;
|
||||||
@ -71,7 +72,7 @@ pub struct QuerySystemFns<'tcx> {
|
|||||||
|
|
||||||
pub struct QuerySystem<'tcx> {
|
pub struct QuerySystem<'tcx> {
|
||||||
pub states: QueryStates<'tcx>,
|
pub states: QueryStates<'tcx>,
|
||||||
pub arenas: QueryArenas<'tcx>,
|
pub arenas: WorkerLocal<QueryArenas<'tcx>>,
|
||||||
pub caches: QueryCaches<'tcx>,
|
pub caches: QueryCaches<'tcx>,
|
||||||
pub dynamic_queries: DynamicQueries<'tcx>,
|
pub dynamic_queries: DynamicQueries<'tcx>,
|
||||||
|
|
||||||
@ -370,7 +371,7 @@ macro_rules! define_callbacks {
|
|||||||
|
|
||||||
pub struct QueryArenas<'tcx> {
|
pub struct QueryArenas<'tcx> {
|
||||||
$($(#[$attr])* pub $name: query_if_arena!([$($modifiers)*]
|
$($(#[$attr])* pub $name: query_if_arena!([$($modifiers)*]
|
||||||
(WorkerLocal<TypedArena<<$V as Deref>::Target>>)
|
(TypedArena<<$V as Deref>::Target>)
|
||||||
()
|
()
|
||||||
),)*
|
),)*
|
||||||
}
|
}
|
||||||
@ -379,7 +380,7 @@ macro_rules! define_callbacks {
|
|||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
Self {
|
Self {
|
||||||
$($name: query_if_arena!([$($modifiers)*]
|
$($name: query_if_arena!([$($modifiers)*]
|
||||||
(WorkerLocal::new(|_| Default::default()))
|
(Default::default())
|
||||||
()
|
()
|
||||||
),)*
|
),)*
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user