some cleanups

This commit is contained in:
Irmen de Jong
2023-02-09 01:46:23 +01:00
parent 623329fb33
commit 6aabbffc62
34 changed files with 232 additions and 266 deletions

View File

@@ -28,12 +28,9 @@ internal class ProgramAndVarsGen(
private val zeropage: Zeropage
) {
private val compTarget = options.compTarget
// TODO ???? private val callGraph = CallGraph(program, true)
private val blockVariableInitializers = program.allBlocks().associateWith { it.children.filterIsInstance<PtAssignment>() }
internal fun generate() {
val allInitializers = blockVariableInitializers.asSequence().flatMap { it.value } // TODO unused?
header()
val allBlocks = program.allBlocks()
if(allBlocks.first().name != "main")
@@ -278,7 +275,7 @@ internal class ProgramAndVarsGen(
if(sub.inline) {
if(options.optimize) {
TODO("check if sub is unused")
TODO("check if sub is unused, is this even still reached?")
// if(callGraph.unused(sub))
// return