remove a now-useless machine hook

This commit is contained in:
Ralf Jung
2022-08-07 12:33:44 -04:00
parent 4173e971b8
commit aff9841507
4 changed files with 5 additions and 33 deletions

View File

@@ -444,7 +444,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
}
}
/// Read from a local. Will not actually access the local if reading from a ZST.
/// Read from a local.
/// Will not access memory, instead an indirect `Operand` is returned.
///
/// This is public because it is used by [priroda](https://github.com/oli-obk/priroda) to get an
@@ -456,12 +456,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
layout: Option<TyAndLayout<'tcx>>,
) -> InterpResult<'tcx, OpTy<'tcx, M::Provenance>> {
let layout = self.layout_of_local(frame, local, layout)?;
let op = if layout.is_zst() {
// Bypass `access_local` (helps in ConstProp)
Operand::Immediate(Immediate::Uninit)
} else {
*M::access_local(frame, local)?
};
let op = *frame.locals[local].access()?;
Ok(OpTy { op, layout, align: Some(layout.align.abi) })
}