Update match branches
This updates all places where match branches check on StatementKind or UseContext. This doesn't properly implement them, but adds TODOs where they are, and also adds some best guesses to what they should be in some cases.
This commit is contained in:
@@ -293,8 +293,7 @@ impl<'mir, 'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> Visitor<'tcx>
|
||||
| MutatingUseContext::AsmOutput
|
||||
| MutatingUseContext::Borrow
|
||||
| MutatingUseContext::AddressOf
|
||||
| MutatingUseContext::Projection
|
||||
| MutatingUseContext::CopyNonOverlapping,
|
||||
| MutatingUseContext::Projection,
|
||||
)
|
||||
| PlaceContext::NonMutatingUse(
|
||||
NonMutatingUseContext::Inspect
|
||||
@@ -302,8 +301,7 @@ impl<'mir, 'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> Visitor<'tcx>
|
||||
| NonMutatingUseContext::UniqueBorrow
|
||||
| NonMutatingUseContext::ShallowBorrow
|
||||
| NonMutatingUseContext::AddressOf
|
||||
| NonMutatingUseContext::Projection
|
||||
| NonMutatingUseContext::CopyNonOverlapping,
|
||||
| NonMutatingUseContext::Projection,
|
||||
) => {
|
||||
self.not_ssa(local);
|
||||
}
|
||||
|
||||
@@ -120,18 +120,22 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
|
||||
ref dst,
|
||||
ref size,
|
||||
}) => {
|
||||
let dst_val = self.codegen_place(&mut bx, dst.as_ref());
|
||||
let src_val = self.codegen_place(&mut bx, src.as_ref());
|
||||
let dst_val = self.codegen_operand(&mut bx, dst);
|
||||
let src_val = self.codegen_operand(&mut bx, src);
|
||||
let size_val = self.codegen_operand(&mut bx, size);
|
||||
let size = size_val.immediate_or_packed_pair(&mut bx);
|
||||
let dst = dst_val.immediate_or_packed_pair(&mut bx);
|
||||
let src = src_val.immediate_or_packed_pair(&mut bx);
|
||||
use crate::MemFlags;
|
||||
let flags =
|
||||
(!MemFlags::UNALIGNED) & (!MemFlags::VOLATILE) & (!MemFlags::NONTEMPORAL);
|
||||
bx.memcpy(
|
||||
dst_val.llval,
|
||||
dst_val.align,
|
||||
src_val.llval,
|
||||
src_val.align,
|
||||
dst,
|
||||
dst_val.layout.layout.align.pref,
|
||||
src,
|
||||
src_val.layout.layout.align.pref,
|
||||
size,
|
||||
// TODO probably want to have this change based on alignment above?
|
||||
crate::MemFlags::empty(),
|
||||
flags,
|
||||
);
|
||||
bx
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user