summaryrefslogtreecommitdiff
path: root/python/mediumlevelil.py
diff options
context:
space:
mode:
authorKyleMiles <krm504@nyu.edu>2023-10-04 13:42:46 -0400
committerKyle Martin <krm504@nyu.edu>2023-11-28 12:20:49 -0500
commit66fe34a49322d0a63d8f6efe00ca20d9a2c4ce05 (patch)
treed30fe71da070ddf7c4df5bcda2d14f7e7ac387e4 /python/mediumlevelil.py
parent72a45487eb191ba17603edb3224d47b1184bdf0e (diff)
Add SSAVariable.def_site and SSAVariable.use_sites
Diffstat (limited to 'python/mediumlevelil.py')
-rw-r--r--python/mediumlevelil.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/python/mediumlevelil.py b/python/mediumlevelil.py
index c1c4d231..1ae61d38 100644
--- a/python/mediumlevelil.py
+++ b/python/mediumlevelil.py
@@ -85,6 +85,20 @@ class SSAVariable:
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):