Skip to content

Commit b9c9678

Browse files
compiler: Revert -Zregparm handling for extern Rust
1 parent d6f5b43 commit b9c9678

File tree

4 files changed

+0
-85
lines changed

4 files changed

+0
-85
lines changed

compiler/rustc_target/src/callconv/mod.rs

-22
Original file line numberDiff line numberDiff line change
@@ -720,28 +720,6 @@ impl<'a, Ty> FnAbi<'a, Ty> {
720720

721721
Ok(())
722722
}
723-
724-
pub fn fill_inregs_for_rust_abi<C>(&mut self, cx: &C)
725-
where
726-
Ty: TyAbiInterface<'a, C> + Copy,
727-
C: HasTargetSpec + HasX86AbiOpt,
728-
{
729-
let spec = cx.target_spec();
730-
match &spec.arch[..] {
731-
"x86" => {
732-
x86::fill_inregs(
733-
cx,
734-
self,
735-
x86::X86Options {
736-
flavor: x86::Flavor::General,
737-
regparm: cx.x86_abi_opt().regparm,
738-
},
739-
true,
740-
);
741-
}
742-
_ => {}
743-
}
744-
}
745723
}
746724

747725
impl FromStr for Conv {

compiler/rustc_ty_utils/src/abi.rs

-3
Original file line numberDiff line numberDiff line change
@@ -797,9 +797,6 @@ fn fn_abi_adjust_for_abi<'tcx>(
797797
for (arg_idx, arg) in fn_abi.args.iter_mut().enumerate() {
798798
fixup(arg, Some(arg_idx));
799799
}
800-
if tcx.sess.target.arch == "x86" {
801-
fn_abi.fill_inregs_for_rust_abi(cx);
802-
}
803800
} else {
804801
fn_abi
805802
.adjust_for_foreign_abi(cx, abi)

tests/codegen/regparm-inreg-rust-cc.rs

-53
This file was deleted.

tests/codegen/regparm-inreg.rs

-7
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,6 @@ pub mod tests {
2525
#[no_mangle]
2626
pub extern "fastcall" fn f1(_: i32, _: i32, _: i32) {}
2727

28-
// regparm0: @f2(i32 noundef %_1, i32 noundef %_2, i32 noundef %_3)
29-
// regparm1: @f2(i32 inreg noundef %_1, i32 noundef %_2, i32 noundef %_3)
30-
// regparm2: @f2(i32 inreg noundef %_1, i32 inreg noundef %_2, i32 noundef %_3)
31-
// regparm3: @f2(i32 inreg noundef %_1, i32 inreg noundef %_2, i32 inreg noundef %_3)
32-
#[no_mangle]
33-
pub extern "Rust" fn f2(_: i32, _: i32, _: i32) {}
34-
3528
// regparm0: @f3(i32 noundef %_1, i32 noundef %_2, i32 noundef %_3)
3629
// regparm1: @f3(i32 inreg noundef %_1, i32 noundef %_2, i32 noundef %_3)
3730
// regparm2: @f3(i32 inreg noundef %_1, i32 inreg noundef %_2, i32 noundef %_3)

0 commit comments

Comments
 (0)