Skip to content

Commit

Permalink
Add SSAVariable.def_site and SSAVariable.use_sites
Browse files Browse the repository at this point in the history
  • Loading branch information
ElykDeer committed Nov 28, 2023
1 parent 72a4548 commit 66fe34a
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions python/mediumlevelil.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,20 @@ def function(self) -> 'function.Function':
def dead_store_elimination(self) -> DeadStoreElimination:
return self.var.dead_store_elimination

@property
def def_site(self) -> Optional['MediumLevelILInstruction']:
"""
Gets the MediumLevelILInstruction where this SSAVariable is defined.
"""
return self.var.function.get_ssa_var_definition(self)

@property
def use_sites(self) -> List['MediumLevelILInstruction']:
"""
Gets the list of MediumLevelILInstructions where this SSAVariable is used inside of this function.
"""
return self.var.function.get_ssa_var_uses(self)


class MediumLevelILLabel:
def __init__(self, handle: Optional[core.BNMediumLevelILLabel] = None):
Expand Down

0 comments on commit 66fe34a

Please sign in to comment.