1
Fork 0

remove a machine hook that is no longer used

This commit is contained in:
Ralf Jung 2024-03-09 18:15:56 +01:00
parent 2005c2e54d
commit b888e895de
3 changed files with 0 additions and 24 deletions

View file

@ -221,9 +221,6 @@ impl<'tcx, Prov: Provenance> LocalState<'tcx, Prov> {
/// Overwrite the local. If the local can be overwritten in place, return a reference
/// to do so; otherwise return the `MemPlace` to consult instead.
///
/// Note: Before calling this, call the `before_access_local_mut` machine hook! You may be
/// invalidating machine invariants otherwise!
#[inline(always)]
pub(super) fn access_mut(&mut self) -> InterpResult<'tcx, &mut Operand<Prov>> {
match &mut self.value {

View file

@ -260,24 +260,6 @@ pub trait Machine<'mir, 'tcx: 'mir>: Sized {
F2::NAN
}
/// Called before writing the specified `local` of the `frame`.
/// Since writing a ZST is not actually accessing memory or locals, this is never invoked
/// for ZST reads.
///
/// Due to borrow checker trouble, we indicate the `frame` as an index rather than an `&mut
/// Frame`.
#[inline(always)]
fn before_access_local_mut<'a>(
_ecx: &'a mut InterpCx<'mir, 'tcx, Self>,
_frame: usize,
_local: mir::Local,
) -> InterpResult<'tcx>
where
'tcx: 'mir,
{
Ok(())
}
/// Called before a basic block terminator is executed.
#[inline]
fn before_terminator(_ecx: &mut InterpCx<'mir, 'tcx, Self>) -> InterpResult<'tcx> {

View file

@ -624,7 +624,6 @@ where
dest.force_mplace(self)?
} else {
debug_assert_eq!(locals_addr, self.frame().locals_addr());
M::before_access_local_mut(self, self.frame_idx(), local)?;
match self.frame_mut().locals[local].access_mut()? {
Operand::Immediate(local_val) => {
// Local can be updated in-place.
@ -740,7 +739,6 @@ where
dest.force_mplace(self)?
} else {
debug_assert_eq!(locals_addr, self.frame().locals_addr());
M::before_access_local_mut(self, self.frame_idx(), local)?;
match self.frame_mut().locals[local].access_mut()? {
Operand::Immediate(local) => {
*local = Immediate::Uninit;
@ -921,7 +919,6 @@ where
let mplace = match place.place {
Place::Local { local, offset, locals_addr } => {
debug_assert_eq!(locals_addr, self.frame().locals_addr());
M::before_access_local_mut(self, self.frame_idx(), local)?;
let whole_local = match self.frame_mut().locals[local].access_mut()? {
&mut Operand::Immediate(local_val) => {
// We need to make an allocation.