mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 06:44:35 +00:00
Update fmt and use of memcpy
I'm still not totally sure if this is the right way to implement the memcpy, but that portion compiles correctly now. Now to fix the compile errors everywhere else :).
This commit is contained in:
parent
0fdc07e197
commit
72c734d001
@ -120,15 +120,20 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
|
||||
ref dst,
|
||||
ref size,
|
||||
}) => {
|
||||
bx.memcpy(
|
||||
dst,
|
||||
todo!(),
|
||||
src,
|
||||
todo!(),
|
||||
size,
|
||||
todo!(),
|
||||
);
|
||||
bx
|
||||
let dst_val = self.codegen_place(&mut bx, dst.as_ref());
|
||||
let src_val = self.codegen_place(&mut bx, src.as_ref());
|
||||
let size_val = self.codegen_operand(&mut bx, size);
|
||||
let size = size_val.immediate_or_packed_pair(&mut bx);
|
||||
bx.memcpy(
|
||||
dst_val.llval,
|
||||
dst_val.align,
|
||||
src_val.llval,
|
||||
src_val.align,
|
||||
size,
|
||||
// TODO probably want to have this change based on alignment above?
|
||||
crate::MemFlags::empty(),
|
||||
);
|
||||
bx
|
||||
}
|
||||
mir::StatementKind::FakeRead(..)
|
||||
| mir::StatementKind::Retag { .. }
|
||||
|
@ -1668,7 +1668,7 @@ impl Debug for Statement<'_> {
|
||||
ref src,
|
||||
ref dst,
|
||||
ref size,
|
||||
}) => write!(fmt, "src {:?} -> dst {:?}, {:?} bytes", src, dst, size),
|
||||
}) => write!(fmt, "copy_nonoverlapping(src={:?}, dst={:?},bytes={:?})", src, dst, size),
|
||||
Nop => write!(fmt, "nop"),
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user