mirror of
https://github.com/irmen/prog8.git
synced 2024-12-23 09:32:43 +00:00
no need for intermediary returnvalue var for prefix expressions
This commit is contained in:
parent
77c2b2b326
commit
1462c57d0c
@ -317,8 +317,7 @@ internal class FunctionCallAsmGen(private val program: Program, private val asmg
|
|||||||
lda $sourceName
|
lda $sourceName
|
||||||
beq +
|
beq +
|
||||||
sec
|
sec
|
||||||
+ pla
|
+ pla""")
|
||||||
""")
|
|
||||||
}
|
}
|
||||||
else -> {
|
else -> {
|
||||||
asmgen.assignExpressionToRegister(value, RegisterOrPair.A)
|
asmgen.assignExpressionToRegister(value, RegisterOrPair.A)
|
||||||
|
@ -466,21 +466,13 @@ class StatementOptimizer(private val program: Program,
|
|||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
when(returnStmt.value) {
|
if(returnStmt.value is BinaryExpression) {
|
||||||
is PrefixExpression -> {
|
|
||||||
val mod = returnViaIntermediaryVar(returnStmt.value!!)
|
val mod = returnViaIntermediaryVar(returnStmt.value!!)
|
||||||
if(mod!=null)
|
if(mod!=null)
|
||||||
return mod
|
return mod
|
||||||
}
|
}
|
||||||
is BinaryExpression -> {
|
|
||||||
val mod = returnViaIntermediaryVar(returnStmt.value!!)
|
|
||||||
if(mod!=null)
|
|
||||||
return mod
|
|
||||||
}
|
|
||||||
else -> {}
|
|
||||||
}
|
|
||||||
|
|
||||||
return super.after(returnStmt, parent)
|
return noModifications
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun hasBreak(scope: IStatementContainer): Boolean {
|
private fun hasBreak(scope: IStatementContainer): Boolean {
|
||||||
|
@ -3,10 +3,6 @@ TODO
|
|||||||
|
|
||||||
For next compiler release (7.6)
|
For next compiler release (7.6)
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
why does the following use a intermediate return value and not just A?
|
|
||||||
sub pushing_start() -> ubyte {
|
|
||||||
return joy_info & 16
|
|
||||||
}
|
|
||||||
...
|
...
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user