diff options
| author | bors <bors@rust-lang.org> | 2025-03-24 15:02:09 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2025-03-24 15:02:09 +0000 |
| commit | 4510e86a41388733675465a8647d4235f3bf2023 (patch) | |
| tree | c851d1e39a4cdf96f7ed110856055084a8b27926 /compiler/rustc_incremental | |
| parent | 90f5eab952728ac6edcf529a171f7de5c25e5d49 (diff) | |
| parent | 2736a2a84f972baabe4012f890aaae14489af8d9 (diff) | |
| download | rust-4510e86a41388733675465a8647d4235f3bf2023.tar.gz rust-4510e86a41388733675465a8647d4235f3bf2023.zip | |
Auto merge of #138629 - Zoxc:graph-anon-hashmap, r=oli-obk
Only use the new node hashmap for anonymous nodes This is a rebase of https://github.com/rust-lang/rust/pull/112469. cc `@cjgillot`
Diffstat (limited to 'compiler/rustc_incremental')
| -rw-r--r-- | compiler/rustc_incremental/src/persist/load.rs | 11 | ||||
| -rw-r--r-- | compiler/rustc_incremental/src/persist/save.rs | 2 |
2 files changed, 8 insertions, 5 deletions
diff --git a/compiler/rustc_incremental/src/persist/load.rs b/compiler/rustc_incremental/src/persist/load.rs index 50e47533ab6..0e646b136c4 100644 --- a/compiler/rustc_incremental/src/persist/load.rs +++ b/compiler/rustc_incremental/src/persist/load.rs @@ -91,7 +91,10 @@ fn delete_dirty_work_product(sess: &Session, swp: SerializedWorkProduct) { work_product::delete_workproduct_files(sess, &swp.work_product); } -fn load_dep_graph(sess: &Session) -> LoadResult<(Arc<SerializedDepGraph>, WorkProductMap)> { +fn load_dep_graph( + sess: &Session, + deps: &DepsType, +) -> LoadResult<(Arc<SerializedDepGraph>, WorkProductMap)> { let prof = sess.prof.clone(); if sess.opts.incremental.is_none() { @@ -171,7 +174,7 @@ fn load_dep_graph(sess: &Session) -> LoadResult<(Arc<SerializedDepGraph>, WorkPr return LoadResult::DataOutOfDate; } - let dep_graph = SerializedDepGraph::decode::<DepsType>(&mut decoder); + let dep_graph = SerializedDepGraph::decode::<DepsType>(&mut decoder, deps); LoadResult::Ok { data: (dep_graph, prev_work_products) } } @@ -205,11 +208,11 @@ pub fn load_query_result_cache(sess: &Session) -> Option<OnDiskCache> { /// Setups the dependency graph by loading an existing graph from disk and set up streaming of a /// new graph to an incremental session directory. -pub fn setup_dep_graph(sess: &Session, crate_name: Symbol) -> DepGraph { +pub fn setup_dep_graph(sess: &Session, crate_name: Symbol, deps: &DepsType) -> DepGraph { // `load_dep_graph` can only be called after `prepare_session_directory`. prepare_session_directory(sess, crate_name); - let res = sess.opts.build_dep_graph().then(|| load_dep_graph(sess)); + let res = sess.opts.build_dep_graph().then(|| load_dep_graph(sess, deps)); if sess.opts.incremental.is_some() { sess.time("incr_comp_garbage_collect_session_directories", || { diff --git a/compiler/rustc_incremental/src/persist/save.rs b/compiler/rustc_incremental/src/persist/save.rs index 8fc50ca1b43..94ce6d9fa81 100644 --- a/compiler/rustc_incremental/src/persist/save.rs +++ b/compiler/rustc_incremental/src/persist/save.rs @@ -173,7 +173,7 @@ pub(crate) fn build_dep_graph( sess.opts.dep_tracking_hash(false).encode(&mut encoder); Some(DepGraph::new( - &sess.prof, + sess, prev_graph, prev_work_products, encoder, |
