Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
04e7a10
intrinsics: unify rint, roundeven, nearbyint in a single round_ties_e…
RalfJung Feb 4, 2025
c930bb2
rustc_codegen_ssa: use slice patterns instead of len-check+indexing
yotamofek Feb 2, 2025
9e5e6a9
rustc_codegen_ssa: cleanup nested `if`s and a needless `match`
yotamofek Feb 2, 2025
a821785
rustc_codegen_ssa: simplify test for incompatible dependency formats
yotamofek Feb 2, 2025
73d5fe1
rustc_codegen_ssa: cleanup codegen attrs
yotamofek Feb 2, 2025
2c1f489
fix rustdoc test directives that were accidentally ignored
yotamofek Feb 15, 2025
17f2928
Adds binary_format to rustc target specs
Pyr0de Feb 14, 2025
d1b34ac
make the new intrinsics safe
RalfJung Feb 22, 2025
506532a
The sym crate is not a thing
compiler-errors Feb 23, 2025
54dd4c8
bootstrap: add module docs for core:metadata
Shourya742 Feb 23, 2025
08f1086
Update `compiler-builtins` to 0.1.147
tgross35 Feb 20, 2025
b9d0555
add stdarch compatibility hack
RalfJung Feb 23, 2025
c813d8f
rename sub_ptr 😅
bend-n Feb 23, 2025
31719b5
Rollup merge of #136439 - yotamofek:pr/codegen-ssa-no-indexing, r=Nor…
tgross35 Feb 23, 2025
a2bb4d7
Rollup merge of #136543 - RalfJung:round-ties-even, r=tgross35
tgross35 Feb 23, 2025
2c6fa32
Rollup merge of #136637 - Pyr0de:binary-format, r=Noratrieb
tgross35 Feb 23, 2025
5f35f78
Rollup merge of #137099 - yotamofek:pr/rustdoc/fix-ignored-test-direc…
tgross35 Feb 23, 2025
fb54acd
Rollup merge of #137297 - tgross35:update-builtins, r=tgross35
tgross35 Feb 23, 2025
781203d
Rollup merge of #137451 - compiler-errors:synm, r=Noratrieb
tgross35 Feb 23, 2025
e8342e7
Rollup merge of #137452 - Shourya742:2025-02-23-add-module-level-doc-…
tgross35 Feb 23, 2025
18ffee2
Rollup merge of #137483 - bend-n:😅, r=Noratrieb
tgross35 Feb 23, 2025
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
rustc_codegen_ssa: cleanup nested ifs and a needless match
  • Loading branch information
yotamofek committed Feb 11, 2025
commit 9e5e6a9d0fc95d7f5a22ca8da0816d407977c674
7 changes: 3 additions & 4 deletions compiler/rustc_codegen_ssa/src/back/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -626,10 +626,9 @@ fn link_staticlib(

let mut all_rust_dylibs = vec![];
for &cnum in crates {
match fmts.get(cnum) {
Some(&Linkage::Dynamic) => {}
_ => continue,
}
let Some(Linkage::Dynamic) = fmts.get(cnum) else {
continue;
};
let crate_name = codegen_results.crate_info.crate_name[&cnum];
let used_crate_source = &codegen_results.crate_info.used_crate_source[&cnum];
if let Some((path, _)) = &used_crate_source.dylib {
Expand Down
5 changes: 3 additions & 2 deletions compiler/rustc_codegen_ssa/src/back/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1537,8 +1537,9 @@ fn start_executing_work<B: ExtraBackendMethods>(
// Spin up what work we can, only doing this while we've got available
// parallelism slots and work left to spawn.
if codegen_state != Aborted {
while !work_items.is_empty() && running_with_own_token < tokens.len() {
let (item, _) = work_items.pop().unwrap();
while running_with_own_token < tokens.len()
&& let Some((item, _)) = work_items.pop()
{
spawn_work(
&cgcx,
&mut llvm_start_time,
Expand Down
35 changes: 15 additions & 20 deletions compiler/rustc_codegen_ssa/src/codegen_attrs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -655,25 +655,20 @@ fn codegen_fn_attrs(tcx: TyCtxt<'_>, did: LocalDefId) -> CodegenFnAttrs {
// llvm/llvm-project#70563).
if !codegen_fn_attrs.target_features.is_empty()
&& matches!(codegen_fn_attrs.inline, InlineAttr::Always)
&& let Some(span) = inline_span
{
if let Some(span) = inline_span {
tcx.dcx().span_err(span, "cannot use `#[inline(always)]` with `#[target_feature]`");
}
tcx.dcx().span_err(span, "cannot use `#[inline(always)]` with `#[target_feature]`");
}

if !codegen_fn_attrs.no_sanitize.is_empty() && codegen_fn_attrs.inline.always() {
if let (Some(no_sanitize_span), Some(inline_span)) = (no_sanitize_span, inline_span) {
let hir_id = tcx.local_def_id_to_hir_id(did);
tcx.node_span_lint(
lint::builtin::INLINE_NO_SANITIZE,
hir_id,
no_sanitize_span,
|lint| {
lint.primary_message("`no_sanitize` will have no effect after inlining");
lint.span_note(inline_span, "inlining requested here");
},
)
}
if !codegen_fn_attrs.no_sanitize.is_empty()
&& codegen_fn_attrs.inline.always()
&& let (Some(no_sanitize_span), Some(inline_span)) = (no_sanitize_span, inline_span)
{
let hir_id = tcx.local_def_id_to_hir_id(did);
tcx.node_span_lint(lint::builtin::INLINE_NO_SANITIZE, hir_id, no_sanitize_span, |lint| {
lint.primary_message("`no_sanitize` will have no effect after inlining");
lint.span_note(inline_span, "inlining requested here");
})
}

// Weak lang items have the same semantics as "std internal" symbols in the
Expand Down Expand Up @@ -703,10 +698,10 @@ fn codegen_fn_attrs(tcx: TyCtxt<'_>, did: LocalDefId) -> CodegenFnAttrs {
// Any linkage to LLVM intrinsics for now forcibly marks them all as never
// unwinds since LLVM sometimes can't handle codegen which `invoke`s
// intrinsic functions.
if let Some(name) = &codegen_fn_attrs.link_name {
if name.as_str().starts_with("llvm.") {
codegen_fn_attrs.flags |= CodegenFnAttrFlags::NEVER_UNWIND;
}
if let Some(name) = &codegen_fn_attrs.link_name
&& name.as_str().starts_with("llvm.")
{
codegen_fn_attrs.flags |= CodegenFnAttrFlags::NEVER_UNWIND;
}

if let Some(features) = check_tied_features(
Expand Down
5 changes: 3 additions & 2 deletions compiler/rustc_codegen_ssa/src/mir/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -990,8 +990,9 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
});

// Split the rust-call tupled arguments off.
let (first_args, untuple) = if abi == ExternAbi::RustCall && !args.is_empty() {
let (tup, args) = args.split_last().unwrap();
let (first_args, untuple) = if abi == ExternAbi::RustCall
&& let Some((tup, args)) = args.split_last()
{
(args, Some(tup))
} else {
(args, None)
Expand Down