Skip to content

Commit

Permalink
black
Browse files Browse the repository at this point in the history
  • Loading branch information
rihi committed Apr 18, 2024
1 parent f850af0 commit dd3a543
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
10 changes: 5 additions & 5 deletions decompiler/pipeline/ssa/dependency_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@

def dependency_graph_from_cfg(cfg: ControlFlowGraph) -> MultiDiGraph:
"""
Construct the dependency graph of the given CFG, i.e. adds an edge between two variables if they depend on each other.
- Add an edge the definition to at most one requirement for each instruction.
- All variables that where not defined via Phi-functions before have out-degree of at most 1, because they are defined at most once.
- Variables that are defined via Phi-functions can have one successor for each required variable of the Phi-function.
"""
Construct the dependency graph of the given CFG, i.e. adds an edge between two variables if they depend on each other.
- Add an edge the definition to at most one requirement for each instruction.
- All variables that where not defined via Phi-functions before have out-degree of at most 1, because they are defined at most once.
- Variables that are defined via Phi-functions can have one successor for each required variable of the Phi-function.
"""
dependency_graph = MultiDiGraph()

for variable in _collect_variables(cfg):
Expand Down
4 changes: 3 additions & 1 deletion decompiler/pipeline/ssa/outofssatranslation.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,9 @@ def _out_of_ssa(self) -> None:
"""
strategy = self.out_of_ssa_strategy.get(self._optimization, None)
if strategy is None:
raise NotImplementedError(f"The Out of SSA according to the optimization level {self._optimization.value} is not implemented so far.")
raise NotImplementedError(
f"The Out of SSA according to the optimization level {self._optimization.value} is not implemented so far."
)

strategy(self)

Expand Down
2 changes: 1 addition & 1 deletion decompiler/pipeline/ssa/variable_renaming.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ def __init__(self, task, interference_graph: InterferenceGraph):
# self._decorate_graph(dependency_graph, f"dep{counter}.svg")

self._variable_classes_handler = VariableClassesHandler(defaultdict(set))
for (i, vars) in enumerate(dependency_graph.nodes):
for i, vars in enumerate(dependency_graph.nodes):
for var in vars:
self._variable_classes_handler.add_variable_to_class(var, i)

Expand Down

0 comments on commit dd3a543

Please sign in to comment.