Deduplicate store_operand_direct and store_operand

This commit is contained in:
Mark-Simulacrum 2016-12-15 10:39:29 -07:00 committed by Mark Simulacrum
parent 6710af3580
commit 31691692a2
2 changed files with 3 additions and 12 deletions

View File

@ -244,17 +244,8 @@ impl<'bcx, 'tcx> MirContext<'bcx, 'tcx> {
pub fn store_operand(&mut self,
bcx: &BlockAndBuilder<'bcx, 'tcx>,
lldest: ValueRef,
operand: OperandRef<'tcx>)
{
debug!("store_operand: operand={:?} lldest={:?}", operand, lldest);
self.store_operand_direct(bcx, lldest, operand)
}
pub fn store_operand_direct(&mut self,
bcx: &BlockAndBuilder<'bcx, 'tcx>,
lldest: ValueRef,
operand: OperandRef<'tcx>)
{
operand: OperandRef<'tcx>) {
debug!("store_operand: operand={:?}", operand);
// Avoid generating stores of zero-sized values, because the only way to have a zero-sized
// value is through `undef`, and store itself is useless.
if common::type_is_zero_size(bcx.ccx(), operand.ty) {

View File

@ -99,7 +99,7 @@ impl<'bcx, 'tcx> MirContext<'bcx, 'tcx> {
let size = C_uint(bcx.ccx(), size);
let base = base::get_dataptr(&bcx, dest.llval);
tvec::slice_for_each(&bcx, base, tr_elem.ty, size, |bcx, llslot| {
self.store_operand_direct(&bcx, llslot, tr_elem);
self.store_operand(&bcx, llslot, tr_elem);
})
}