Skip to content

Commit cd519aa

Browse files
committed
fix gcc, cranelift build
1 parent 22e13b4 commit cd519aa

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/abi.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ impl<'gcc, 'tcx> FnAbiGccExt<'gcc, 'tcx> for FnAbi<'tcx, Ty<'tcx>> {
113113
match self.ret.mode {
114114
PassMode::Ignore => cx.type_void(),
115115
PassMode::Direct(_) | PassMode::Pair(..) => self.ret.layout.immediate_gcc_type(cx),
116-
PassMode::Cast(ref cast, _) => cast.gcc_type(cx),
116+
PassMode::Cast { ref cast, .. } => cast.gcc_type(cx),
117117
PassMode::Indirect { .. } => {
118118
argument_tys.push(cx.type_ptr_to(self.ret.memory_ty(cx)));
119119
cx.type_void()
@@ -132,7 +132,7 @@ impl<'gcc, 'tcx> FnAbiGccExt<'gcc, 'tcx> for FnAbi<'tcx, Ty<'tcx>> {
132132
PassMode::Indirect { meta_attrs: Some(_), .. } => {
133133
unimplemented!();
134134
}
135-
PassMode::Cast(ref cast, pad_i32) => {
135+
PassMode::Cast { ref cast, pad_i32 } => {
136136
// add padding
137137
if pad_i32 {
138138
argument_tys.push(Reg::i32().gcc_type(cx));

src/intrinsic/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ impl<'a, 'gcc, 'tcx> IntrinsicCallMethods<'tcx> for Builder<'a, 'gcc, 'tcx> {
144144
sym::volatile_load | sym::unaligned_volatile_load => {
145145
let tp_ty = fn_args.type_at(0);
146146
let mut ptr = args[0].immediate();
147-
if let PassMode::Cast(ty, _) = &fn_abi.ret.mode {
147+
if let PassMode::Cast { cast: ty, .. } = &fn_abi.ret.mode {
148148
ptr = self.pointercast(ptr, self.type_ptr_to(ty.gcc_type(self)));
149149
}
150150
let load = self.volatile_load(ptr.get_type(), ptr);
@@ -353,7 +353,7 @@ impl<'a, 'gcc, 'tcx> IntrinsicCallMethods<'tcx> for Builder<'a, 'gcc, 'tcx> {
353353
};
354354

355355
if !fn_abi.ret.is_ignore() {
356-
if let PassMode::Cast(ty, _) = &fn_abi.ret.mode {
356+
if let PassMode::Cast { cast: ty, .. } = &fn_abi.ret.mode {
357357
let ptr_llty = self.type_ptr_to(ty.gcc_type(self));
358358
let ptr = self.pointercast(result.llval, ptr_llty);
359359
self.store(llval, ptr, result.align);
@@ -449,7 +449,7 @@ impl<'gcc, 'tcx> ArgAbiExt<'gcc, 'tcx> for ArgAbi<'tcx, Ty<'tcx>> {
449449
else if self.is_unsized_indirect() {
450450
bug!("unsized `ArgAbi` must be handled through `store_fn_arg`");
451451
}
452-
else if let PassMode::Cast(ref cast, _) = self.mode {
452+
else if let PassMode::Cast { ref cast, .. } = self.mode {
453453
// FIXME(eddyb): Figure out when the simpler Store is safe, clang
454454
// uses it for i16 -> {i8, i8}, but not for i24 -> {i8, i8, i8}.
455455
let can_store_through_cast_ptr = false;
@@ -514,7 +514,7 @@ impl<'gcc, 'tcx> ArgAbiExt<'gcc, 'tcx> for ArgAbi<'tcx, Ty<'tcx>> {
514514
PassMode::Indirect { meta_attrs: Some(_), .. } => {
515515
OperandValue::Ref(next(), Some(next()), self.layout.align.abi).store(bx, dst);
516516
},
517-
PassMode::Direct(_) | PassMode::Indirect { meta_attrs: None, .. } | PassMode::Cast(..) => {
517+
PassMode::Direct(_) | PassMode::Indirect { meta_attrs: None, .. } | PassMode::Cast { .. } => {
518518
let next_arg = next();
519519
self.store(bx, next_arg, dst);
520520
},

0 commit comments

Comments
 (0)