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>
impl<'a> Walk<'a>
Sourcepub fn new(func: &'a Func, module: &'a Module) -> Self
pub fn new(func: &'a Func, module: &'a Module) -> Self
A walk over this function, with GCC’s budget.
Sourcepub fn with(
func: &'a Func,
module: &'a Module,
options: Options,
limit: u32,
) -> Self
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.
Sourcepub const fn alias(&self) -> &Alias<'a>
pub const fn alias(&self) -> &Alias<'a>
The alias analysis underneath, whose own counters say which layer answered.
Sourcepub fn clobber(&mut self, load: Inst) -> Clobber
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.
Sourcepub fn clobber_with(
&mut self,
load: Inst,
translate: &mut dyn FnMut(&Access, Inst) -> Step,
) -> Clobber
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.