From b543cc34cdc7975926f6c1950d1ef4807988e8f7 Mon Sep 17 00:00:00 2001 From: Irmen de Jong Date: Thu, 18 Feb 2021 01:52:56 +0100 Subject: [PATCH] no longer warn about removing unused asmsubs --- compiler/src/prog8/optimizer/StatementOptimizer.kt | 3 ++- docs/source/todo.rst | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) 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)