Skip to content

Rollup of 7 pull requests #111981

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
e26c0c9
Inline and remove `numbered_codegen_unit_name`.
nnethercote May 24, 2023
b39b709
Remove the `merging` module.
nnethercote May 24, 2023
20de2ba
Remove `{Pre,Post}InliningPartitioning`.
nnethercote May 24, 2023
59c5259
Add a clarifying comment.
nnethercote May 24, 2023
86754cd
Remove some unnecessary `pub` markers.
nnethercote May 25, 2023
ed216e2
Streamline `modify_size_estimate`.
nnethercote May 25, 2023
d816b8b
Fix Mac Catalyst linking by adding build version
bmisiak May 9, 2023
dd56f93
Clarify safety concern of `io::Read::read` is only relevant in unsafe…
zirconium-n May 25, 2023
dee65a4
fix for `Self` not respecting tuple Ctor privacy
fee1-dead May 5, 2023
00f9fe4
Use translatable diagnostics in `rustc_const_eval`
fee1-dead May 17, 2023
91525a4
Use ErrorGuaranteed more in MIR type ops
compiler-errors May 24, 2023
0a35db5
Fallible<_> -> Result<_, NoSolution>
compiler-errors May 25, 2023
a61f026
Mac Catalyst: specify 14.0 deployment taregt in llvm_target
bmisiak May 25, 2023
b37cdc6
Add test for RPIT defined with different hidden types with different …
obeis May 25, 2023
e6b99a6
Add struct for the return type of `place_root_mono_items`.
nnethercote May 25, 2023
f207f33
Rollup merge of #111245 - fee1-dead-contrib:temp-fix-tuple-struct-fie…
compiler-errors May 26, 2023
3794e36
Rollup merge of #111384 - bmisiak:issue-106021-fix, r=petrochenkov
compiler-errors May 26, 2023
d0ce0a5
Rollup merge of #111677 - fee1-dead-contrib:rustc_const_eval-translat…
compiler-errors May 26, 2023
4dad986
Rollup merge of #111899 - nnethercote:cgu-cleanups, r=wesleywiser
compiler-errors May 26, 2023
bff15d1
Rollup merge of #111918 - compiler-errors:custom-type-ops-err, r=lcnr
compiler-errors May 26, 2023
75dd7a2
Rollup merge of #111940 - zirconium-n:io-read-doc-change, r=thomcc
compiler-errors May 26, 2023
91ddc05
Rollup merge of #111947 - obeis:issue-111943, r=compiler-errors
compiler-errors May 26, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add struct for the return type of place_root_mono_items.
As per review request.
nnethercote committed May 25, 2023
commit e6b99a6521535d79a53b2111f236f82fae0b123e
7 changes: 4 additions & 3 deletions compiler/rustc_monomorphize/src/partitioning/default.rs
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@ use rustc_span::symbol::Symbol;

use super::PartitioningCx;
use crate::collector::InliningMap;
use crate::partitioning::{MonoItemPlacement, Partition};
use crate::partitioning::{MonoItemPlacement, Partition, PlacedRootMonoItems};

pub struct DefaultPartitioning;

@@ -24,7 +24,7 @@ impl<'tcx> Partition<'tcx> for DefaultPartitioning {
&mut self,
cx: &PartitioningCx<'_, 'tcx>,
mono_items: &mut I,
) -> (Vec<CodegenUnit<'tcx>>, FxHashSet<MonoItem<'tcx>>, FxHashSet<MonoItem<'tcx>>)
) -> PlacedRootMonoItems<'tcx>
where
I: Iterator<Item = MonoItem<'tcx>>,
{
@@ -89,7 +89,8 @@ impl<'tcx> Partition<'tcx> for DefaultPartitioning {
codegen_units.insert(codegen_unit_name, CodegenUnit::new(codegen_unit_name));
}

(codegen_units.into_values().collect(), roots, internalization_candidates)
let codegen_units = codegen_units.into_values().collect();
PlacedRootMonoItems { codegen_units, roots, internalization_candidates }
}

fn merge_codegen_units(
12 changes: 9 additions & 3 deletions compiler/rustc_monomorphize/src/partitioning/mod.rs
Original file line number Diff line number Diff line change
@@ -128,7 +128,7 @@ impl<'tcx> Partition<'tcx> for Partitioner {
&mut self,
cx: &PartitioningCx<'_, 'tcx>,
mono_items: &mut I,
) -> (Vec<CodegenUnit<'tcx>>, FxHashSet<MonoItem<'tcx>>, FxHashSet<MonoItem<'tcx>>)
) -> PlacedRootMonoItems<'tcx>
where
I: Iterator<Item = MonoItem<'tcx>>,
{
@@ -188,12 +188,18 @@ struct PartitioningCx<'a, 'tcx> {
inlining_map: &'a InliningMap<'tcx>,
}

pub struct PlacedRootMonoItems<'tcx> {
codegen_units: Vec<CodegenUnit<'tcx>>,
roots: FxHashSet<MonoItem<'tcx>>,
internalization_candidates: FxHashSet<MonoItem<'tcx>>,
}

trait Partition<'tcx> {
fn place_root_mono_items<I>(
&mut self,
cx: &PartitioningCx<'_, 'tcx>,
mono_items: &mut I,
) -> (Vec<CodegenUnit<'tcx>>, FxHashSet<MonoItem<'tcx>>, FxHashSet<MonoItem<'tcx>>)
) -> PlacedRootMonoItems<'tcx>
where
I: Iterator<Item = MonoItem<'tcx>>;

@@ -247,7 +253,7 @@ where
// In the first step, we place all regular monomorphizations into their
// respective 'home' codegen unit. Regular monomorphizations are all
// functions and statics defined in the local crate.
let (mut codegen_units, roots, internalization_candidates) = {
let PlacedRootMonoItems { mut codegen_units, roots, internalization_candidates } = {
let _prof_timer = tcx.prof.generic_activity("cgu_partitioning_place_roots");
partitioner.place_root_mono_items(cx, mono_items)
};