C# Class Reko.Analysis.ConditionCodeEliminator

Removes any uses and definitions of condition codes.
Removal of condition codes becomes exciting in situations like the following (x86 code): add ax,bx mov [si],ax jnz foo or cmp ax,0 jl less jg greater

For best performance, preprocess the intermediate code with the ValuePropagator transformer.

Inheritance: InstructionTransformer
ファイルを表示 Open project: uxmal/reko Class Usage Examples

Public Methods

Method Description
ClosureOfUsingStatements ( Reko.Analysis.SsaIdentifier sid, Expression expr, HashSet uses, HashSet aliases ) : HashSet

Computes the close of a web of using statements. The uses hash set will contain all non-trivial uses of the expression.

ComparisonFromConditionCode ( ConditionCode cc, BinaryExpression bin, bool isNegated ) : Expression
ComparisonFromOverflow ( BinaryExpression bin, bool isNegated ) : Expression
ConditionCodeEliminator ( Reko.Analysis.SsaState ssa, IPlatform arch ) : Reko.Core
Negate ( ConditionCode cc ) : ConditionCode
Transform ( ) : void
TransformAssignment ( Assignment a ) : Instruction
UseGrfConditionally ( Reko.Analysis.SsaIdentifier sid, ConditionCode cc ) : Expression
VisitTestCondition ( TestCondition tc ) : Expression

Private Methods

Method Description
CmpExpressionToZero ( Expression e ) : BinaryExpression
IsAddOrSub ( Reko.Core.Operators.Operator op ) : bool
IsCopyWithOptionalCast ( Identifier grf, Reko.Core.Statement stm ) : bool

Returns true if the instruction in the statement is an assignment of the form grf = src or grf = (foo) src

IsLocallyDefinedFlagGroup ( Reko.Analysis.SsaIdentifier sid ) : bool
TransformAddOrSub ( Assignment a, BinaryExpression binUse ) : Instruction
TransformRolC ( Application rolc, Assignment a ) : Instruction
TransformRorC ( Application rorc, Assignment a ) : Instruction
Use ( Expression expr, Reko.Core.Statement stm ) : void

Method Details

ClosureOfUsingStatements() public method

Computes the close of a web of using statements. The uses hash set will contain all non-trivial uses of the expression.
public ClosureOfUsingStatements ( Reko.Analysis.SsaIdentifier sid, Expression expr, HashSet uses, HashSet aliases ) : HashSet
sid Reko.Analysis.SsaIdentifier
expr Expression
uses HashSet
aliases HashSet
return HashSet

ComparisonFromConditionCode() public method

public ComparisonFromConditionCode ( ConditionCode cc, BinaryExpression bin, bool isNegated ) : Expression
cc ConditionCode
bin BinaryExpression
isNegated bool
return Expression

ComparisonFromOverflow() public method

public ComparisonFromOverflow ( BinaryExpression bin, bool isNegated ) : Expression
bin BinaryExpression
isNegated bool
return Expression

ConditionCodeEliminator() public method

public ConditionCodeEliminator ( Reko.Analysis.SsaState ssa, IPlatform arch ) : Reko.Core
ssa Reko.Analysis.SsaState
arch IPlatform
return Reko.Core

Negate() public static method

public static Negate ( ConditionCode cc ) : ConditionCode
cc ConditionCode
return ConditionCode

Transform() public method

public Transform ( ) : void
return void

TransformAssignment() public method

public TransformAssignment ( Assignment a ) : Instruction
a Assignment
return Instruction

UseGrfConditionally() public method

public UseGrfConditionally ( Reko.Analysis.SsaIdentifier sid, ConditionCode cc ) : Expression
sid Reko.Analysis.SsaIdentifier
cc ConditionCode
return Expression

VisitTestCondition() public method

public VisitTestCondition ( TestCondition tc ) : Expression
tc TestCondition
return Expression