rust_for_linux: -Zregparm=<N> commandline flag for X86 (#116972)
This commit is contained in:
@@ -21,7 +21,9 @@ use rustc_span::{DUMMY_SP, ErrorGuaranteed, Span};
|
||||
use rustc_target::abi::call::FnAbi;
|
||||
use rustc_target::abi::{FieldIdx, TyAbiInterface, VariantIdx, call};
|
||||
use rustc_target::spec::abi::Abi as SpecAbi;
|
||||
use rustc_target::spec::{HasTargetSpec, HasWasmCAbiOpt, PanicStrategy, Target, WasmCAbi};
|
||||
use rustc_target::spec::{
|
||||
HasTargetSpec, HasWasmCAbiOpt, HasX86AbiOpt, PanicStrategy, Target, WasmCAbi, X86Abi,
|
||||
};
|
||||
use tracing::debug;
|
||||
use {rustc_abi as abi, rustc_hir as hir};
|
||||
|
||||
@@ -544,6 +546,12 @@ impl<'tcx> HasWasmCAbiOpt for TyCtxt<'tcx> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'tcx> HasX86AbiOpt for TyCtxt<'tcx> {
|
||||
fn x86_abi_opt(&self) -> X86Abi {
|
||||
X86Abi { regparm: self.sess.opts.unstable_opts.regparm }
|
||||
}
|
||||
}
|
||||
|
||||
impl<'tcx> HasTyCtxt<'tcx> for TyCtxt<'tcx> {
|
||||
#[inline]
|
||||
fn tcx(&self) -> TyCtxt<'tcx> {
|
||||
@@ -595,6 +603,12 @@ impl<'tcx> HasWasmCAbiOpt for LayoutCx<'tcx> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'tcx> HasX86AbiOpt for LayoutCx<'tcx> {
|
||||
fn x86_abi_opt(&self) -> X86Abi {
|
||||
self.calc.cx.x86_abi_opt()
|
||||
}
|
||||
}
|
||||
|
||||
impl<'tcx> HasTyCtxt<'tcx> for LayoutCx<'tcx> {
|
||||
fn tcx(&self) -> TyCtxt<'tcx> {
|
||||
self.calc.cx
|
||||
|
||||
Reference in New Issue
Block a user