mirror of
https://github.com/irmen/prog8.git
synced 2024-09-07 19:54:26 +00:00
avoid work
This commit is contained in:
parent
1436480eab
commit
8acd94fc89
@ -1 +1 @@
|
|||||||
8.10-dev
|
8.10
|
||||||
|
@ -153,17 +153,6 @@ internal class NotExpressionAndIfComparisonExprChanger(val program: Program, val
|
|||||||
if(compTarget.name == VMTarget.NAME) // don't apply this optimization for Vm target
|
if(compTarget.name == VMTarget.NAME) // don't apply this optimization for Vm target
|
||||||
return CondExprSimplificationResult(null, null, null, null)
|
return CondExprSimplificationResult(null, null, null, null)
|
||||||
|
|
||||||
var leftAssignment: Assignment? = null
|
|
||||||
var leftOperandReplacement: Expression? = null
|
|
||||||
var rightAssignment: Assignment? = null
|
|
||||||
var rightOperandReplacement: Expression? = null
|
|
||||||
|
|
||||||
val separateLeftExpr = !expr.left.isSimple
|
|
||||||
&& expr.left !is IFunctionCall
|
|
||||||
&& expr.left !is ContainmentCheck
|
|
||||||
val separateRightExpr = !expr.right.isSimple
|
|
||||||
&& expr.right !is IFunctionCall
|
|
||||||
&& expr.right !is ContainmentCheck
|
|
||||||
val leftDt = expr.left.inferType(program)
|
val leftDt = expr.left.inferType(program)
|
||||||
val rightDt = expr.right.inferType(program)
|
val rightDt = expr.right.inferType(program)
|
||||||
|
|
||||||
@ -172,6 +161,17 @@ internal class NotExpressionAndIfComparisonExprChanger(val program: Program, val
|
|||||||
return CondExprSimplificationResult(null, null, null, null)
|
return CondExprSimplificationResult(null, null, null, null)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var leftAssignment: Assignment? = null
|
||||||
|
var leftOperandReplacement: Expression? = null
|
||||||
|
var rightAssignment: Assignment? = null
|
||||||
|
var rightOperandReplacement: Expression? = null
|
||||||
|
val separateLeftExpr = !expr.left.isSimple
|
||||||
|
&& expr.left !is IFunctionCall
|
||||||
|
&& expr.left !is ContainmentCheck
|
||||||
|
val separateRightExpr = !expr.right.isSimple
|
||||||
|
&& expr.right !is IFunctionCall
|
||||||
|
&& expr.right !is ContainmentCheck
|
||||||
|
|
||||||
if(separateLeftExpr) {
|
if(separateLeftExpr) {
|
||||||
val name = getTempRegisterName(leftDt)
|
val name = getTempRegisterName(leftDt)
|
||||||
leftOperandReplacement = IdentifierReference(name, expr.position)
|
leftOperandReplacement = IdentifierReference(name, expr.position)
|
||||||
|
Loading…
Reference in New Issue
Block a user