mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-07 01:05:39 +03:00
Move WorkerLocal out of QueryArenas
This cuts librustc_driver.so code size by ~85 kilobytes.
This commit is contained in:
@@ -61,7 +61,6 @@
|
||||
use rustc_data_structures::steal::Steal;
|
||||
use rustc_data_structures::svh::Svh;
|
||||
use rustc_data_structures::sync::Lrc;
|
||||
use rustc_data_structures::sync::WorkerLocal;
|
||||
use rustc_data_structures::unord::UnordSet;
|
||||
use rustc_errors::ErrorGuaranteed;
|
||||
use rustc_hir as hir;
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
use measureme::StringId;
|
||||
use rustc_data_structures::fx::FxHashMap;
|
||||
use rustc_data_structures::sync::AtomicU64;
|
||||
use rustc_data_structures::sync::WorkerLocal;
|
||||
use rustc_hir::def::DefKind;
|
||||
use rustc_hir::def_id::{DefId, LocalDefId};
|
||||
use rustc_hir::hir_id::OwnerId;
|
||||
@@ -71,7 +72,7 @@ pub struct QuerySystemFns<'tcx> {
|
||||
|
||||
pub struct QuerySystem<'tcx> {
|
||||
pub states: QueryStates<'tcx>,
|
||||
pub arenas: QueryArenas<'tcx>,
|
||||
pub arenas: WorkerLocal<QueryArenas<'tcx>>,
|
||||
pub caches: QueryCaches<'tcx>,
|
||||
pub dynamic_queries: DynamicQueries<'tcx>,
|
||||
|
||||
@@ -370,7 +371,7 @@ pub fn provided_to_erased<'tcx>(
|
||||
|
||||
pub struct QueryArenas<'tcx> {
|
||||
$($(#[$attr])* pub $name: query_if_arena!([$($modifiers)*]
|
||||
(WorkerLocal<TypedArena<<$V as Deref>::Target>>)
|
||||
(TypedArena<<$V as Deref>::Target>)
|
||||
()
|
||||
),)*
|
||||
}
|
||||
@@ -379,7 +380,7 @@ impl Default for QueryArenas<'_> {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
$($name: query_if_arena!([$($modifiers)*]
|
||||
(WorkerLocal::new(|_| Default::default()))
|
||||
(Default::default())
|
||||
()
|
||||
),)*
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user