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§
Sourcefn is_function(&self, name: &str) -> bool
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.
Sourcefn is_template(&self, name: &str) -> bool
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.
Sourcefn function(&mut self, name: &str) -> Result<&Cfg, AnalysisError>
fn function(&mut self, name: &str) -> Result<&Cfg, AnalysisError>
Returns the CFG for the function with the given name.
Sourcefn template(&mut self, name: &str) -> Result<&Cfg, AnalysisError>
fn template(&mut self, name: &str) -> Result<&Cfg, AnalysisError>
Returns the CFG for the template with the given name.
Sourcefn underlying_str(
&self,
file_id: &FileID,
file_location: &FileLocation,
) -> Result<String, AnalysisError>
fn underlying_str( &self, file_id: &FileID, file_location: &FileLocation, ) -> Result<String, AnalysisError>
Returns the string corresponding to the given file ID and location.