Skip to content

Commit cccf379

Browse files
committed
Put PlaceValue into OperandValue::Ref, rather than 3 tuple fields
1 parent b9b05d5 commit cccf379

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

src/builder.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -999,8 +999,9 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> {
999999
}
10001000
}
10011001

1002-
let val = if let Some(llextra) = place.val.llextra {
1003-
OperandValue::Ref(place.val.llval, Some(llextra), place.val.align)
1002+
let val = if let Some(_) = place.val.llextra {
1003+
// FIXME: Merge with the `else` below?
1004+
OperandValue::Ref(place.val)
10041005
} else if place.layout.is_gcc_immediate() {
10051006
let load = self.load(place.layout.gcc_type(self), place.val.llval, place.val.align);
10061007
if let abi::Abi::Scalar(ref scalar) = place.layout.abi {
@@ -1031,7 +1032,7 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> {
10311032
load(1, b, place.val.align.restrict_for_offset(b_offset)),
10321033
)
10331034
} else {
1034-
OperandValue::Ref(place.val.llval, None, place.val.align)
1035+
OperandValue::Ref(place.val)
10351036
};
10361037

10371038
OperandRef { val, layout: place.layout }

src/intrinsic/mod.rs

+8-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use rustc_codegen_ssa::base::wants_msvc_seh;
1111
use rustc_codegen_ssa::common::IntPredicate;
1212
use rustc_codegen_ssa::errors::InvalidMonomorphization;
1313
use rustc_codegen_ssa::mir::operand::{OperandRef, OperandValue};
14-
use rustc_codegen_ssa::mir::place::PlaceRef;
14+
use rustc_codegen_ssa::mir::place::{PlaceRef, PlaceValue};
1515
use rustc_codegen_ssa::traits::{
1616
ArgAbiMethods, BuilderMethods, ConstMethods, IntrinsicCallMethods,
1717
};
@@ -502,7 +502,7 @@ impl<'gcc, 'tcx> ArgAbiExt<'gcc, 'tcx> for ArgAbi<'tcx, Ty<'tcx>> {
502502
return;
503503
}
504504
if self.is_sized_indirect() {
505-
OperandValue::Ref(val, None, self.layout.align.abi).store(bx, dst)
505+
OperandValue::Ref(PlaceValue::new_sized(val, self.layout.align.abi)).store(bx, dst)
506506
} else if self.is_unsized_indirect() {
507507
bug!("unsized `ArgAbi` must be handled through `store_fn_arg`");
508508
} else if let PassMode::Cast { ref cast, .. } = self.mode {
@@ -571,7 +571,12 @@ impl<'gcc, 'tcx> ArgAbiExt<'gcc, 'tcx> for ArgAbi<'tcx, Ty<'tcx>> {
571571
OperandValue::Pair(next(), next()).store(bx, dst);
572572
}
573573
PassMode::Indirect { meta_attrs: Some(_), .. } => {
574-
OperandValue::Ref(next(), Some(next()), self.layout.align.abi).store(bx, dst);
574+
let place_val = PlaceValue {
575+
llval: next(),
576+
llextra: Some(next()),
577+
align: self.layout.align.abi,
578+
};
579+
OperandValue::Ref(place_val).store(bx, dst);
575580
}
576581
PassMode::Direct(_)
577582
| PassMode::Indirect { meta_attrs: None, .. }

0 commit comments

Comments
 (0)