dewolf
dewolf copied to clipboard
[Restructuring] Resolve unresolved reaching conditions
closes #28
The first example of the Issue does decompile differently now, such the problem does not exist. The question is whether we want to still consider cases like this:
Pro: Would improve readability if both branches have the same sub-expression, as it could be moved up as a reaching-condition of the condition-node
Contra: Increase of the runtime. Whenever we introduce a new condition node, we have to check whether its children have a common sub-expression. In case both children are no sequence-nodes, we have to check for two nodes whether they have a common sub-expression, i.e., we compare each clause. However, due to strange simplifications this may not be sufficient, but would at least get us some of these cases. But, if one child is a sequence node, we have to check this for all children.
Question: Do we want to implement this for none, some or all cases? A good compromise could be to only check for equal clauses, and maybe miss some. Additionally, we could restrict this to condition-nodes where both children are no sequence-nodes.
The second part is implemented and ready for review. No matter what the decision is, I would suggest writing a new Issue for the first part, since it is already quite a long PR.