pub struct Alias<'a> { /* private fields */ }Expand description
The analysis over one function.
It borrows the module because a global’s address is a symbol and whether two symbols are two objects is a question about the module, and it borrows the function because everything else is. The escape analysis is run once when this is built, since every query may ask it and it is one walk over the function.
Implementations§
Source§impl<'a> Alias<'a>
impl<'a> Alias<'a>
Sourcepub fn new(func: &'a Func, module: &'a Module) -> Self
pub fn new(func: &'a Func, module: &'a Module) -> Self
The analysis of this function, with the type-based layer on, which is GCC’s -O2.
Sourcepub fn with(func: &'a Func, module: &'a Module, options: Options) -> Self
pub fn with(func: &'a Func, module: &'a Module, options: Options) -> Self
The same, with the type-based layer where the command line left it.
Sourcepub const fn escapes(&self) -> &Escapes
pub const fn escapes(&self) -> &Escapes
Which locals escaped, for a caller that wants the fact on its own.
Sourcepub fn reads(&self, inst: Inst) -> Option<Access>
pub fn reads(&self, inst: Inst) -> Option<Access>
The bytes this instruction reads, if it reads any.
Sourcepub fn writes(&self, inst: Inst) -> Option<Access>
pub fn writes(&self, inst: Inst) -> Option<Access>
The bytes this instruction writes, if it writes any.
Sourcepub fn query(&mut self, a: &Access, b: &Access) -> Answer
pub fn query(&mut self, a: &Access, b: &Access) -> Answer
Whether these two references can touch the same byte.
Sourcepub fn clobbered_by(&mut self, reference: &Access, call: Inst) -> Answer
pub fn clobbered_by(&mut self, reference: &Access, call: Inst) -> Answer
Whether this call can write the bytes the reference covers.
GCC’s call_may_clobber_ref_p_1. Without interprocedural summaries the honest answer for
anything whose address escaped is yes, and section 8.4 says so plainly: the full mod and
ref summary is ipa-modref, it is five and a half thousand lines, and it is document
34’s. What is here is the cheap part of it, which is the attributes a C programmer
already wrote and the escape analysis.