From 95f16c38a9d0015f78aa077747af77352010df78 Mon Sep 17 00:00:00 2001 From: Irmen de Jong Date: Sun, 3 Apr 2022 15:56:14 +0200 Subject: [PATCH] removed 'aug' property in PtAssignment , it wasn't used for anything --- codeAst/src/prog8/code/ast/AstStatements.kt | 6 ++---- .../src/prog8/codegen/experimental/AstToXmlConverter.kt | 1 - compiler/src/prog8/compiler/IntermediateAstMaker.kt | 2 +- docs/source/todo.rst | 1 + 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/codeAst/src/prog8/code/ast/AstStatements.kt b/codeAst/src/prog8/code/ast/AstStatements.kt index f713eed26..34a1f0510 100644 --- a/codeAst/src/prog8/code/ast/AstStatements.kt +++ b/codeAst/src/prog8/code/ast/AstStatements.kt @@ -38,15 +38,13 @@ class PtSubroutineParameter(val name: String, val type: DataType, position: Posi } -class PtAssignment(val augmentable: Boolean, position: Position) : PtNode(position) { +class PtAssignment(position: Position) : PtNode(position) { val target: PtAssignTarget get() = children[0] as PtAssignTarget val value: PtExpression get() = children[1] as PtExpression - override fun printProperties() { - print("aug=$augmentable") - } + override fun printProperties() { } } diff --git a/codeGenExperimental/src/prog8/codegen/experimental/AstToXmlConverter.kt b/codeGenExperimental/src/prog8/codegen/experimental/AstToXmlConverter.kt index a37a69e7c..2c75663f6 100644 --- a/codeGenExperimental/src/prog8/codegen/experimental/AstToXmlConverter.kt +++ b/codeGenExperimental/src/prog8/codegen/experimental/AstToXmlConverter.kt @@ -445,7 +445,6 @@ class AstToXmlConverter(internal val program: PtProgram, private fun write(assign: PtAssignment) { xml.elt("assign") - xml.attr("aug", assign.augmentable.toString()) xml.pos(assign.position) xml.startChildren() write(assign.target) diff --git a/compiler/src/prog8/compiler/IntermediateAstMaker.kt b/compiler/src/prog8/compiler/IntermediateAstMaker.kt index f859ca101..51e4d6187 100644 --- a/compiler/src/prog8/compiler/IntermediateAstMaker.kt +++ b/compiler/src/prog8/compiler/IntermediateAstMaker.kt @@ -96,7 +96,7 @@ class IntermediateAstMaker(val program: Program) { return PtNop(srcAssign.position) } - val assign = PtAssignment(srcAssign.isAugmentable, srcAssign.position) + val assign = PtAssignment(srcAssign.position) assign.add(transform(srcAssign.target)) assign.add(transformExpression(srcAssign.value)) return assign diff --git a/docs/source/todo.rst b/docs/source/todo.rst index 849200dd1..e2ffd2c5f 100644 --- a/docs/source/todo.rst +++ b/docs/source/todo.rst @@ -5,6 +5,7 @@ For next release ^^^^^^^^^^^^^^^^ - vm: support no globals re-init option - vm: make registers typed? so that it's immediately obvious what type they represent. Much like regular variables in memory. +- vm: don't store symbol names in instructions to make optimizing the IR easier? but what about jumps to labels. And it's no longer readable by humans. - vm codegen/assembler: variable memory locations should also be referenced by the variable name instead of just the address, to make the output more human-readable - vm: how to remove all unused subroutines? (in the assembly codegen, we let 64tass solve this for us) - vm: rather than being able to jump to any 'address' (IPTR), use 'blocks' that have entry and exit points -> even better dead code elimination possible too