Skip to content

Commit

Permalink
compiler: Revert -Zregparm handling for extern Rust
Browse files Browse the repository at this point in the history
  • Loading branch information
workingjubilee committed Oct 18, 2024
1 parent d6f5b43 commit b9c9678
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 85 deletions.
22 changes: 0 additions & 22 deletions compiler/rustc_target/src/callconv/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -720,28 +720,6 @@ impl<'a, Ty> FnAbi<'a, Ty> {

Ok(())
}

pub fn fill_inregs_for_rust_abi<C>(&mut self, cx: &C)
where
Ty: TyAbiInterface<'a, C> + Copy,
C: HasTargetSpec + HasX86AbiOpt,
{
let spec = cx.target_spec();
match &spec.arch[..] {
"x86" => {
x86::fill_inregs(
cx,
self,
x86::X86Options {
flavor: x86::Flavor::General,
regparm: cx.x86_abi_opt().regparm,
},
true,
);
}
_ => {}
}
}
}

impl FromStr for Conv {
Expand Down
3 changes: 0 additions & 3 deletions compiler/rustc_ty_utils/src/abi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -797,9 +797,6 @@ fn fn_abi_adjust_for_abi<'tcx>(
for (arg_idx, arg) in fn_abi.args.iter_mut().enumerate() {
fixup(arg, Some(arg_idx));
}
if tcx.sess.target.arch == "x86" {
fn_abi.fill_inregs_for_rust_abi(cx);
}
} else {
fn_abi
.adjust_for_foreign_abi(cx, abi)
Expand Down
53 changes: 0 additions & 53 deletions tests/codegen/regparm-inreg-rust-cc.rs

This file was deleted.

7 changes: 0 additions & 7 deletions tests/codegen/regparm-inreg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,6 @@ pub mod tests {
#[no_mangle]
pub extern "fastcall" fn f1(_: i32, _: i32, _: i32) {}

// regparm0: @f2(i32 noundef %_1, i32 noundef %_2, i32 noundef %_3)
// regparm1: @f2(i32 inreg noundef %_1, i32 noundef %_2, i32 noundef %_3)
// regparm2: @f2(i32 inreg noundef %_1, i32 inreg noundef %_2, i32 noundef %_3)
// regparm3: @f2(i32 inreg noundef %_1, i32 inreg noundef %_2, i32 inreg noundef %_3)
#[no_mangle]
pub extern "Rust" fn f2(_: i32, _: i32, _: i32) {}

// regparm0: @f3(i32 noundef %_1, i32 noundef %_2, i32 noundef %_3)
// regparm1: @f3(i32 inreg noundef %_1, i32 noundef %_2, i32 noundef %_3)
// regparm2: @f3(i32 inreg noundef %_1, i32 inreg noundef %_2, i32 noundef %_3)
Expand Down

0 comments on commit b9c9678

Please sign in to comment.