Skip to content

Commit 35a99c1

Browse files
committed
rustc_target: hide TargetOptions::vendor
1 parent 5873ee5 commit 35a99c1

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

src/abi/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -916,8 +916,8 @@ pub(crate) fn codegen_call_with_unwind_action(
916916
pub(crate) fn lib_call_arg_param(tcx: TyCtxt<'_>, ty: Type, is_signed: bool) -> AbiParam {
917917
let param = AbiParam::new(ty);
918918
if ty.is_int() && u64::from(ty.bits()) < tcx.data_layout.pointer_size().bits() {
919-
match (&tcx.sess.target.arch, tcx.sess.target.vendor.as_ref()) {
920-
(Arch::X86_64, _) | (Arch::AArch64, "apple") => match (ty, is_signed) {
919+
match (&tcx.sess.target.arch, tcx.sess.target.is_like_darwin) {
920+
(Arch::X86_64, _) | (Arch::AArch64, true) => match (ty, is_signed) {
921921
(types::I8 | types::I16, true) => param.sext(),
922922
(types::I8 | types::I16, false) => param.uext(),
923923
_ => param,

src/codegen_f16_f128.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use crate::prelude::*;
55

66
pub(crate) fn f16_to_f32(fx: &mut FunctionCx<'_, '_, '_>, value: Value) -> Value {
77
let (value, arg_ty) =
8-
if fx.tcx.sess.target.vendor == "apple" && fx.tcx.sess.target.arch == Arch::X86_64 {
8+
if fx.tcx.sess.target.is_like_darwin && fx.tcx.sess.target.arch == Arch::X86_64 {
99
(
1010
fx.bcx.ins().bitcast(types::I16, MemFlags::new(), value),
1111
lib_call_arg_param(fx.tcx, types::I16, false),
@@ -22,8 +22,7 @@ fn f16_to_f64(fx: &mut FunctionCx<'_, '_, '_>, value: Value) -> Value {
2222
}
2323

2424
pub(crate) fn f32_to_f16(fx: &mut FunctionCx<'_, '_, '_>, value: Value) -> Value {
25-
let ret_ty = if fx.tcx.sess.target.vendor == "apple" && fx.tcx.sess.target.arch == Arch::X86_64
26-
{
25+
let ret_ty = if fx.tcx.sess.target.is_like_darwin && fx.tcx.sess.target.arch == Arch::X86_64 {
2726
types::I16
2827
} else {
2928
types::F16
@@ -38,8 +37,7 @@ pub(crate) fn f32_to_f16(fx: &mut FunctionCx<'_, '_, '_>, value: Value) -> Value
3837
}
3938

4039
fn f64_to_f16(fx: &mut FunctionCx<'_, '_, '_>, value: Value) -> Value {
41-
let ret_ty = if fx.tcx.sess.target.vendor == "apple" && fx.tcx.sess.target.arch == Arch::X86_64
42-
{
40+
let ret_ty = if fx.tcx.sess.target.is_like_darwin && fx.tcx.sess.target.arch == Arch::X86_64 {
4341
types::I16
4442
} else {
4543
types::F16

0 commit comments

Comments
 (0)