diff --git a/compiler/src/prog8/optimizer/StatementOptimizer.kt b/compiler/src/prog8/optimizer/StatementOptimizer.kt index e2c1b4722..d8d1954db 100644 --- a/compiler/src/prog8/optimizer/StatementOptimizer.kt +++ b/compiler/src/prog8/optimizer/StatementOptimizer.kt @@ -53,7 +53,8 @@ internal class StatementOptimizer(private val program: Program, } if(subroutine !in callgraph.usedSymbols && !forceOutput) { - errors.warn("removing unused subroutine '${subroutine.name}'", subroutine.position) + if(!subroutine.isAsmSubroutine) + errors.warn("removing unused subroutine '${subroutine.name}'", subroutine.position) return listOf(IAstModification.Remove(subroutine, subroutine.definingScope())) } diff --git a/docs/source/todo.rst b/docs/source/todo.rst index 350a7a582..ca58b875d 100644 --- a/docs/source/todo.rst +++ b/docs/source/todo.rst @@ -2,6 +2,7 @@ TODO ==== +- don't require carry parameter Pc to asmsubs to be last; sort this out yourself like with the R0-R15 registers - make blocks without explicit memory address, word-aligned in the assembly. - add sound to the cx16 tehtriz - hoist all variable declarations up to the subroutine scope *before* even the constant folding takes place (to avoid undefined symbol errors when referring to a variable from another nested scope in the subroutine)