fix vardecl initialization value to not use stack eval anymore but separate assignment

(this causes the optimized assignment code gen to be used instead)
but some programs now end up larger in output size
This commit is contained in:
Irmen de Jong
2021-11-01 00:24:15 +01:00
parent 1b576f826d
commit 1110bd0851
12 changed files with 118 additions and 125 deletions

View File

@@ -41,6 +41,15 @@ sealed class Statement : Node {
else
null
}
fun previousSibling(): Statement? {
val statements = (parent as? IStatementContainer)?.statements ?: return null
val previousIdx = statements.indexOfFirst { it===this } - 1
return if(previousIdx >= 0)
statements[previousIdx]
else
null
}
}