Make the two loops in internalize_symbols have the same form.

Because the next commit will merge them.
This commit is contained in:
Nicholas Nethercote 2023-06-05 12:01:53 +10:00
parent 9fd6d97915
commit 392045b7e7

View File

@ -491,11 +491,14 @@ fn internalize_symbols<'tcx>(
// can internalize all candidates, since there is nowhere else they // can internalize all candidates, since there is nowhere else they
// could be used from. // could be used from.
for cgu in codegen_units { for cgu in codegen_units {
for candidate in &internalization_candidates { for (item, linkage_and_visibility) in cgu.items_mut() {
cgu.items_mut().insert(*candidate, (Linkage::Internal, Visibility::Default)); if !internalization_candidates.contains(item) {
// This item is no candidate for internalizing, so skip it.
continue;
}
*linkage_and_visibility = (Linkage::Internal, Visibility::Default);
} }
} }
return; return;
} }