Skip to main content

Walk

Struct Walk 

Source
pub struct Walk<'a> { /* private fields */ }
Expand description

The walk back through the memory chain.

It borrows the function rather than owning anything, and it holds the alias analysis because every step is a query and the escape analysis inside it is worth building once.

Implementations§

Source§

impl<'a> Walk<'a>

Source

pub fn new(func: &'a Func, module: &'a Module) -> Self

A walk over this function, with GCC’s budget.

Source

pub fn with( func: &'a Func, module: &'a Module, options: Options, limit: u32, ) -> Self

The same, with the alias options the command line left and a budget of your own.

Source

pub const fn counts(&self) -> &Counts

What the walks have cost so far.

Source

pub const fn alias(&self) -> &Alias<'a>

The alias analysis underneath, whose own counters say which layer answered.

Source

pub fn clobber(&mut self, load: Inst) -> Clobber

The store this load sees.

Clobber::Unknown for an instruction that reads nothing, for one that is not on the chain, and for a walk that ran out of budget, because all three mean the same thing to a caller, which is that nothing was established.

Source

pub fn clobber_with( &mut self, load: Inst, translate: &mut dyn FnMut(&Access, Inst) -> Step, ) -> Clobber

The same, with the chance to rewrite the reference at every def the walk cannot see past.

Section 9.2’s translate. The callback is handed the reference as it stands and the def in the way, and answers Step::Stop to take the clobber or Step::Retry to carry on past it asking about something else. Following a load through a memcpy by rewriting the reference to the copy’s source is the case worth having it for, since that is what a struct assignment lowers to.

Section 9.6 calls a translate that rewrites the reference wrongly the subtlest bug in the document and essentially untestable by unit test, so the defence is differential execution per document 41 rather than anything here.

Trait Implementations§

Source§

impl<'a> Debug for Walk<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for Walk<'a>

§

impl<'a> RefUnwindSafe for Walk<'a>

§

impl<'a> Send for Walk<'a>

§

impl<'a> Sync for Walk<'a>

§

impl<'a> Unpin for Walk<'a>

§

impl<'a> UnsafeUnpin for Walk<'a>

§

impl<'a> UnwindSafe for Walk<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.