Trait AnalysisContext

Source
pub trait AnalysisContext {
    // Required methods
    fn is_function(&self, name: &str) -> bool;
    fn is_template(&self, name: &str) -> bool;
    fn function(&mut self, name: &str) -> Result<&Cfg, AnalysisError>;
    fn template(&mut self, name: &str) -> Result<&Cfg, AnalysisError>;
    fn underlying_str(
        &self,
        file_id: &FileID,
        file_location: &FileLocation,
    ) -> Result<String, AnalysisError>;
}
Expand description

Context passed to each analysis pass.

Required Methods§

Source

fn is_function(&self, name: &str) -> bool

Returns true if the context knows of a function with the given name. This method does not compute the CFG of the function which saves time compared to AnalysisContext::function.

Source

fn is_template(&self, name: &str) -> bool

Returns true if the context knows of a template with the given name. This method does not compute the CFG of the template which saves time compared to AnalysisContext::template.

Source

fn function(&mut self, name: &str) -> Result<&Cfg, AnalysisError>

Returns the CFG for the function with the given name.

Source

fn template(&mut self, name: &str) -> Result<&Cfg, AnalysisError>

Returns the CFG for the template with the given name.

Source

fn underlying_str( &self, file_id: &FileID, file_location: &FileLocation, ) -> Result<String, AnalysisError>

Returns the string corresponding to the given file ID and location.

Implementors§