pub struct MemorySSA<'a> {
pub effect_analysis: &'a EffectAnalysis,
/* private fields */
}Expand description
MemorySSA analyzer. Reference: https://llvm.org/docs/MemorySSA.html My version is different by analyzing the effect of function calls.
Fields§
§effect_analysis: &'a EffectAnalysisImplementations§
Source§impl<'a> MemorySSA<'a>
impl<'a> MemorySSA<'a>
Sourcepub fn new(program: &Program, effect_analysis: &'a EffectAnalysis) -> Self
pub fn new(program: &Program, effect_analysis: &'a EffectAnalysis) -> Self
Build MemorySSA for program.
Sourcepub fn get_inst_node(&self, inst: InstPtr) -> Option<NodePtr>
pub fn get_inst_node(&self, inst: InstPtr) -> Option<NodePtr>
Get node from instruction.
Sourcepub fn get_block_node(&self, bb: BBPtr) -> Option<NodePtr>
pub fn get_block_node(&self, bb: BBPtr) -> Option<NodePtr>
Get node from block.
Sourcepub fn get_node_block(&self, node: NodePtr) -> Option<BBPtr>
pub fn get_node_block(&self, node: NodePtr) -> Option<BBPtr>
Get block from node.
Sourcepub fn predict_read(
&self,
src: NodePtr,
dst: InstPtr,
func: FunPtr,
) -> Result<Option<Operand>>
pub fn predict_read( &self, src: NodePtr, dst: InstPtr, func: FunPtr, ) -> Result<Option<Operand>>
Assume src writes memory, predict content read from dst.
Sourcepub fn remove_node(&mut self, node: NodePtr)
pub fn remove_node(&mut self, node: NodePtr)
Remove a node, update use-def chain.
§Panics
Do not remove used phi node or entry node with this function!
Auto Trait Implementations§
impl<'a> !Freeze for MemorySSA<'a>
impl<'a> !RefUnwindSafe for MemorySSA<'a>
impl<'a> !Send for MemorySSA<'a>
impl<'a> !Sync for MemorySSA<'a>
impl<'a> Unpin for MemorySSA<'a>
impl<'a> !UnwindSafe for MemorySSA<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more