Ghidra Decompiler Analysis Engine
Classes | Public Member Functions | List of all members
ConditionalJoin Class Reference

Discover and eliminate split conditions. More...

#include <blockaction.hh>

Public Member Functions

bool match (BlockBasic *b1, BlockBasic *b2)
 Test blocks for the merge condition. More...
 
void execute (void)
 Execute the merge. More...
 
void clear (void)
 Clear for a new test.
 

Detailed Description

Discover and eliminate split conditions.

A split condition is when a conditional expression, resulting in a CBRANCH, is duplicated across two blocks that would otherwise merge. Instead of a single conditional in a merged block, there are two copies of the conditional, two splitting blocks and no direct merge.

Member Function Documentation

◆ execute()

void ConditionalJoin::execute ( void  )

Execute the merge.

All the conditions have been met. Go ahead and do the join.

◆ match()

bool ConditionalJoin::match ( BlockBasic b1,
BlockBasic b2 
)

Test blocks for the merge condition.

Given a pair of conditional blocks, make sure that they match the split conditions necessary for merging and set up to do the merge. If the conditions are not met, this method cleans up so that additional calls can be made.

Parameters
b1is the BlockBasic exhibiting one side of the split
b2is the BlockBasic on the other side of the split
Returns
true if the conditions for merging are met

The documentation for this class was generated from the following files: