Skip to content

Rollup of 8 pull requests #130461

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
wants to merge 32 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
6360287
Fix #128930: Print documentation of CLI options missing their arg
GKFX Aug 11, 2024
ae75a9b
Update expectations
GKFX Aug 11, 2024
13e36cf
add new_cyclic_in for rc
Aug 28, 2024
21cb847
fix fmt
Aug 29, 2024
4abb8e2
fix new_cyclic_in for rc
Aug 29, 2024
2383cc9
improve comments
Aug 29, 2024
68169d3
add new_cyclic_in for Arc
Aug 29, 2024
97df334
remove the Clone requirement
Sep 6, 2024
550e55f
Remove duplicate impl
Sep 6, 2024
9d5d03b
Don't call extern_crate when local crate name is the same as a depend…
compiler-errors Sep 12, 2024
05483d5
Relate receiver invariantly in method probe for Mode::Path
compiler-errors Aug 14, 2024
6e982f5
Don't ICE in opaque_hidden_inferred_bound lint for RPITIT in trait wi…
compiler-errors Sep 16, 2024
062ff4d
Encode coroutine_by_move_body_def_id in crate metadata
compiler-errors Sep 10, 2024
af1ca77
Record synthetic MIR bodies in mir_keys
compiler-errors Sep 10, 2024
6750f04
Update library/alloc/src/sync.rs
matthewpipie Sep 17, 2024
978f10d
tests: allow trunc/select instructions to be missing
durin42 Sep 17, 2024
4beb1cf
Fix a couple more DefKind discrepancies between DefKind::Closure and …
compiler-errors Sep 17, 2024
bdacdfe
Minimize visibilities.
nnethercote Sep 5, 2024
cd3da00
Clean up formatting.
nnethercote Sep 10, 2024
52c5de0
Streamline `bin_op_to_[if]cmp_predicate`.
nnethercote Sep 10, 2024
b3b56d8
Remove unnecessary `cx` argument.
nnethercote Sep 11, 2024
ae1f092
Streamline `coroutine_kind_label`.
nnethercote Sep 11, 2024
3ec2f12
Rename some lifetimes.
nnethercote Sep 11, 2024
c629538
Merge some impl blocks.
nnethercote Sep 13, 2024
9b91d67
Rollup merge of #128961 - GKFX:issue-128930-explain-missing-option, r…
fee1-dead Sep 17, 2024
1f1beb6
Rollup merge of #129073 - compiler-errors:receiver-variance, r=lcnr
fee1-dead Sep 17, 2024
5385303
Rollup merge of #129674 - matthewpipie:rc-arc-new-cyclic-in, r=dtolnay
fee1-dead Sep 17, 2024
8a5f499
Rollup merge of #130201 - compiler-errors:foreign-synthetic-body, r=lcnr
fee1-dead Sep 17, 2024
4922280
Rollup merge of #130275 - compiler-errors:extern-crate, r=lcnr
fee1-dead Sep 17, 2024
4a9fbc3
Rollup merge of #130440 - compiler-errors:rpitit-opaque-hidden, r=jie…
fee1-dead Sep 17, 2024
50a8de3
Rollup merge of #130454 - durin42:llvm-20-notrunc, r=workingjubilee
fee1-dead Sep 17, 2024
50fd6ce
Rollup merge of #130458 - nnethercote:rustc_codegen_ssa-cleanups, r=j…
fee1-dead Sep 17, 2024
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
Remove unnecessary cx argument.
Because `bx` contains a `cx`.
  • Loading branch information
nnethercote committed Sep 17, 2024
commit b3b56d805fb0d431a37d56c453602916653dfddc
19 changes: 8 additions & 11 deletions compiler/rustc_codegen_ssa/src/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ pub fn maybe_create_entry_wrapper<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(

let isize_ty = cx.type_isize();
let ptr_ty = cx.type_ptr();
let (arg_argc, arg_argv) = get_argc_argv(cx, &mut bx);
let (arg_argc, arg_argv) = get_argc_argv(&mut bx);

let (start_fn, start_ty, args, instance) = if let EntryFnType::Main { sigpipe } = entry_type
{
Expand Down Expand Up @@ -468,33 +468,30 @@ pub fn maybe_create_entry_wrapper<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
}

/// Obtain the `argc` and `argv` values to pass to the rust start function.
fn get_argc_argv<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
cx: &'a Bx::CodegenCx,
bx: &mut Bx,
) -> (Bx::Value, Bx::Value) {
if cx.sess().target.os.contains("uefi") {
fn get_argc_argv<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(bx: &mut Bx) -> (Bx::Value, Bx::Value) {
if bx.cx().sess().target.os.contains("uefi") {
// Params for UEFI
let param_handle = bx.get_param(0);
let param_system_table = bx.get_param(1);
let ptr_size = bx.tcx().data_layout.pointer_size;
let ptr_align = bx.tcx().data_layout.pointer_align.abi;
let arg_argc = bx.const_int(cx.type_isize(), 2);
let arg_argc = bx.const_int(bx.cx().type_isize(), 2);
let arg_argv = bx.alloca(2 * ptr_size, ptr_align);
bx.store(param_handle, arg_argv, ptr_align);
let arg_argv_el1 = bx.inbounds_ptradd(arg_argv, bx.const_usize(ptr_size.bytes()));
bx.store(param_system_table, arg_argv_el1, ptr_align);
(arg_argc, arg_argv)
} else if cx.sess().target.main_needs_argc_argv {
} else if bx.cx().sess().target.main_needs_argc_argv {
// Params from native `main()` used as args for rust start function
let param_argc = bx.get_param(0);
let param_argv = bx.get_param(1);
let arg_argc = bx.intcast(param_argc, cx.type_isize(), true);
let arg_argc = bx.intcast(param_argc, bx.cx().type_isize(), true);
let arg_argv = param_argv;
(arg_argc, arg_argv)
} else {
// The Rust start function doesn't need `argc` and `argv`, so just pass zeros.
let arg_argc = bx.const_int(cx.type_int(), 0);
let arg_argv = bx.const_null(cx.type_ptr());
let arg_argc = bx.const_int(bx.cx().type_int(), 0);
let arg_argv = bx.const_null(bx.cx().type_ptr());
(arg_argc, arg_argv)
}
}
Expand Down