Move stable_crate_ids
from CrateStore
to Untracked
This way it's like `Definitions`, which creates `DefId`s by interning `DefPathData`s, but for interning stable crate hashes
This commit is contained in:
parent
10be74569c
commit
fbc9b94064
5 changed files with 42 additions and 32 deletions
|
@ -8,7 +8,7 @@ use rustc_codegen_ssa::CodegenResults;
|
|||
use rustc_data_structures::steal::Steal;
|
||||
use rustc_data_structures::svh::Svh;
|
||||
use rustc_data_structures::sync::{AppendOnlyIndexVec, FreezeLock, OnceLock, WorkerLocal};
|
||||
use rustc_hir::def_id::{StableCrateId, LOCAL_CRATE};
|
||||
use rustc_hir::def_id::{StableCrateId, StableCrateIdMap, LOCAL_CRATE};
|
||||
use rustc_hir::definitions::Definitions;
|
||||
use rustc_incremental::setup_dep_graph;
|
||||
use rustc_metadata::creader::CStore;
|
||||
|
@ -140,11 +140,17 @@ impl<'tcx> Queries<'tcx> {
|
|||
|
||||
let cstore = FreezeLock::new(Box::new(CStore::new(
|
||||
self.compiler.codegen_backend.metadata_loader(),
|
||||
stable_crate_id,
|
||||
)) as _);
|
||||
let definitions = FreezeLock::new(Definitions::new(stable_crate_id));
|
||||
let untracked =
|
||||
Untracked { cstore, source_span: AppendOnlyIndexVec::new(), definitions };
|
||||
|
||||
let mut stable_crate_ids = StableCrateIdMap::default();
|
||||
stable_crate_ids.insert(stable_crate_id, LOCAL_CRATE);
|
||||
let untracked = Untracked {
|
||||
cstore,
|
||||
source_span: AppendOnlyIndexVec::new(),
|
||||
definitions,
|
||||
stable_crate_ids: FreezeLock::new(stable_crate_ids),
|
||||
};
|
||||
|
||||
let qcx = passes::create_global_ctxt(
|
||||
self.compiler,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue