mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-16 17:03:35 +00:00
Deduplicate store_operand_direct and store_operand
This commit is contained in:
parent
6710af3580
commit
31691692a2
@ -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) {
|
||||
|
@ -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);
|
||||
})
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user