# Class: com.pnfsoftware.jeb.core.units.code.asm.decompiler.ir.opt.AbstractEOptimizer

Base class for IR optimizers. 

 The no\-arg constructor is for [standard](OptimizerType#NORMAL) optimizers, with DFA updates handled [internally](DataChainsUpdatePolicy#UPDATE_PERFORMED_INTERNALLY).

## Constructor: AbstractEOptimizer

Description: [Standard](OptimizerType#NORMAL) optimizer, DFA updates handled [internally](DataChainsUpdatePolicy#UPDATE_PERFORMED_INTERNALLY).

## Constructor: AbstractEOptimizer
- parameter: `dataChainsUpdatePolicy`, type: `com.pnfsoftware.jeb.core.units.code.asm.decompiler.ir.opt.DataChainsUpdatePolicy`

Description: [Standard](OptimizerType#NORMAL) optimizer.

## Constructor: AbstractEOptimizer
- parameter: `dataChainsUpdatePolicy`, type: `com.pnfsoftware.jeb.core.units.code.asm.decompiler.ir.opt.DataChainsUpdatePolicy`
- parameter: `type`, type: `com.pnfsoftware.jeb.core.units.code.asm.decompiler.opt.OptimizerType`


## Protected Field: cfg
Type: `com.pnfsoftware.jeb.core.units.code.asm.cfg.CFG<com.pnfsoftware.jeb.core.units.code.asm.decompiler.ir.IEStatement>`

## Protected Field: ectx
Type: `com.pnfsoftware.jeb.core.units.code.asm.decompiler.IERoutineContext`

## Protected Method: cleanCfg
- return type: `int`


## Protected Method: deleteUnreachableTrampoline
- parameter: `b`, type: `com.pnfsoftware.jeb.core.units.code.asm.cfg.BasicBlock<com.pnfsoftware.jeb.core.units.code.asm.decompiler.ir.IEStatement>`
- return type: `boolean`


## Protected Method: dumpCfg
- parameter: `filename`, type: `java.lang.String`

Description: Dump the CFG. Convenience method calling [EUtil#dump(CFG, String)](EUtil#dump(CFG, String)).
parameter: filename: filename \(the file will be created in the temp folder\)

## Method: getDataChainsUpdatePolicy
- return type: `com.pnfsoftware.jeb.core.units.code.asm.decompiler.ir.opt.DataChainsUpdatePolicy`


## Method: getMasterOptimizer
- return type: `com.pnfsoftware.jeb.core.units.code.asm.decompiler.ir.opt.IEMasterOptimizer`


## Protected Method: getMasterOptimizerSafe
- return type: `com.pnfsoftware.jeb.core.units.code.asm.decompiler.ir.opt.IEMasterOptimizer`

Description: Safely retrieve a master optimizer. If [#getMasterOptimizer()](#getMasterOptimizer()) provides one, it is returned. Else, an empty immutable generic MO is provided.
return: never null

## Protected Method: perform
- return type: `int`

Description: Perform the optimization pass. The caller may request that data chains not be updated, whenever possible. \(They may be updated internally by the optimizer, which has the final say as to how and when DFA calculations should be run.\) 

 The above means that data chains after running this method may or may not have been modified, and may or may not be in a consistent state with the optimized CFG.
return: the result of a call to one of `postPerform(...)` or a negative number         indicating an error has occurred and the optimizing process should be aborted

## Method: performOnExpression
- parameter: `exp`, type: `com.pnfsoftware.jeb.core.units.code.asm.decompiler.ir.IEGeneric`
- parameter: `ectx`, type: `com.pnfsoftware.jeb.core.units.code.asm.decompiler.IERoutineContext`
- return type: `com.pnfsoftware.jeb.core.units.code.asm.decompiler.ir.IEGeneric`

Description: The default implementation does nothing and returns null.

## Method: performOnTarget
- parameter: `ctx`, type: `com.pnfsoftware.jeb.core.units.code.asm.decompiler.IERoutineContext`
- return type: `int`

Description: Same as `perform(true)`. Data chains will be updated according to the optimizer's DFA policy. 

 The above means that data chains after running this method may be modified, but must be in a consistent state with the CFG.

## Protected Method: postPerform
- parameter: `totalOptimizationCount`, type: `int`
- return type: `int`

Description: Optimizers having [DataChainsUpdatePolicy#UPDATE_IF_OPTIMIZED](DataChainsUpdatePolicy#UPDATE_IF_OPTIMIZED) policy should return using this method.
parameter: totalOptimizationCount: count of optimizations
return: the count of optimizations

## Protected Method: postPerform
- parameter: `totalOptimizationCount`, type: `int`
- parameter: `requestDFA`, type: `boolean`
- return type: `int`

Description: Optimizers having [DataChainsUpdatePolicy#UPDATE_IF_OPTIMIZED](DataChainsUpdatePolicy#UPDATE_IF_OPTIMIZED) or [DataChainsUpdatePolicy#UPDATE_IF_REQUIRED](DataChainsUpdatePolicy#UPDATE_IF_REQUIRED) policy should return using this method.
parameter: totalOptimizationCount: count of optimizations
return: the count of optimizations

## Protected Method: setDataChainsUpdatePolicy
- parameter: `dataChainsUpdatePolicy`, type: `com.pnfsoftware.jeb.core.units.code.asm.decompiler.ir.opt.DataChainsUpdatePolicy`

Description: This method should rarely be called; data\-chains update policy is set up in the constructor, and should not change under normal circumstances.
parameter: dataChainsUpdatePolicy: null means DFA is handled internally, by the optimizer

## Protected Method: verifyCfg

Description: Verify the CFG. Convenience method calling [EUtil#verify(CFG)](EUtil#verify(CFG)).

