Skip to main content

EscapeAnalyzer

Struct EscapeAnalyzer 

Source
pub struct EscapeAnalyzer {
    pub results: HashMap<String, EscapeAnalysisResult>,
}
Expand description

Performs escape analysis over a collection of LCNF function declarations.

Fields§

§results: HashMap<String, EscapeAnalysisResult>

Analysis results keyed by function name.

Implementations§

Source§

impl EscapeAnalyzer

Source

pub fn new() -> Self

Create a new analyzer.

Source

pub fn analyze(&mut self, decls: &[LcnfFunDecl])

Analyze all declarations and store results.

Source

pub fn analyze_decl(&mut self, decl: &LcnfFunDecl) -> EscapeAnalysisResult

Analyze a single function declaration.

Source

pub fn analyze_expr( &self, expr: &LcnfExpr, result: &mut EscapeAnalysisResult, in_tail: bool, )

Recursively analyze an expression.

in_tail is true when the expression appears in tail position (i.e., its value is directly returned from the function).

Source

pub fn propagate_escapes(&self, result: &mut EscapeAnalysisResult)

Propagate escape information: if an allocation’s variable is found in the escape set with a heap-escaping status, upgrade the allocation site.

Trait Implementations§

Source§

impl Debug for EscapeAnalyzer

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for EscapeAnalyzer

Source§

fn default() -> EscapeAnalyzer

Returns the “default value” for a type. Read more

Auto Trait Implementations§

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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.