| 65 | |
| 66 | @dataclass(frozen=True, repr=False, order=True) |
| 67 | class SSAVariable: |
| 68 | var: 'variable.Variable' |
| 69 | version: int |
| 70 | |
| 71 | def __repr__(self): |
| 72 | return f"<SSAVariable: {self.var} version {self.version}>" |
| 73 | |
| 74 | @property |
| 75 | def name(self) -> str: |
| 76 | return self.var.name |
| 77 | |
| 78 | @property |
| 79 | def type(self) -> 'types.Type': |
| 80 | return self.var.type |
| 81 | |
| 82 | @property |
| 83 | def function(self) -> 'function.Function': |
| 84 | """returns the source Function object which this variable belongs to""" |
| 85 | return self.var.function |
| 86 | |
| 87 | @property |
| 88 | def il_function(self) -> 'function.ILFunctionType': |
| 89 | """returns the il Function object which this variable belongs to""" |
| 90 | return self.var._il_function |
| 91 | |
| 92 | @property |
| 93 | def dead_store_elimination(self) -> DeadStoreElimination: |
| 94 | """returns the dead store elimination setting for this variable (read-only)""" |
| 95 | return self.var.dead_store_elimination |
| 96 | |
| 97 | @property |
| 98 | def def_site(self) -> Optional[Union['MediumLevelILInstruction', 'highlevelil.HighLevelILInstruction']]: |
| 99 | """ |
| 100 | Gets the IL instructions where this SSAVariable is defined. |
| 101 | """ |
| 102 | return self.il_function.get_ssa_var_definition(self) |
| 103 | |
| 104 | @property |
| 105 | def use_sites(self) -> List[Union['MediumLevelILInstruction', 'highlevelil.HighLevelILInstruction']]: |
| 106 | """ |
| 107 | Gets the list of IL instructions where this SSAVariable is used inside of this function. |
| 108 | """ |
| 109 | return self.il_function.get_ssa_var_uses(self) |
| 110 | |
| 111 | |
| 112 | class MediumLevelILLabel: |
no outgoing calls
no test coverage detected