diff --git a/codeCore/src/prog8/code/core/CompilationOptions.kt b/codeCore/src/prog8/code/core/CompilationOptions.kt index 402d76798..5b5d8f08c 100644 --- a/codeCore/src/prog8/code/core/CompilationOptions.kt +++ b/codeCore/src/prog8/code/core/CompilationOptions.kt @@ -20,7 +20,6 @@ class CompilationOptions(val output: OutputType, var asmQuiet: Boolean = false, var asmListfile: Boolean = false, var experimentalCodegen: Boolean = false, - var keepIR: Boolean = false, var evalStackBaseAddress: UInt? = null, var outputDir: Path = Path(""), var symbolDefs: Map = emptyMap() diff --git a/codeGenIntermediate/src/prog8/codegen/vm/VmCodeGen.kt b/codeGenIntermediate/src/prog8/codegen/vm/VmCodeGen.kt index d29f3d648..6035ef9a3 100644 --- a/codeGenIntermediate/src/prog8/codegen/vm/VmCodeGen.kt +++ b/codeGenIntermediate/src/prog8/codegen/vm/VmCodeGen.kt @@ -20,7 +20,6 @@ class VmCodeGen(private val program: PtProgram, val irCodeGen = IRCodeGen(program, symbolTable, options, errors) val irProgram = irCodeGen.generate() - // no need to check options.keepIR, as the VM file format *is* the IR file. return VmAssemblyProgram(irProgram.name, irProgram) } } diff --git a/compiler/src/prog8/CompilerMain.kt b/compiler/src/prog8/CompilerMain.kt index 626847b33..bd633a418 100644 --- a/compiler/src/prog8/CompilerMain.kt +++ b/compiler/src/prog8/CompilerMain.kt @@ -41,7 +41,6 @@ private fun compileMain(args: Array): Boolean { val startEmulator1 by cli.option(ArgType.Boolean, fullName = "emu", description = "auto-start emulator after successful compilation") val startEmulator2 by cli.option(ArgType.Boolean, fullName = "emu2", description = "auto-start alternative emulator after successful compilation") val experimentalCodegen by cli.option(ArgType.Boolean, fullName = "expericodegen", description = "use experimental/alternative codegen") - val keepIR by cli.option(ArgType.Boolean, fullName = "keepIR", description = "keep the IR code file (for targets that use it)") val dontWriteAssembly by cli.option(ArgType.Boolean, fullName = "noasm", description="don't create assembly code") val dontOptimize by cli.option(ArgType.Boolean, fullName = "noopt", description = "don't perform any optimizations") val dontReinitGlobals by cli.option(ArgType.Boolean, fullName = "noreinit", description = "don't create code to reinitialize globals on multiple runs of the program (experimental)") @@ -127,7 +126,6 @@ private fun compileMain(args: Array): Boolean { quietAssembler == true, asmListfile == true, experimentalCodegen == true, - keepIR == true, compilationTarget, evalStackAddr, processedSymbols, @@ -192,7 +190,6 @@ private fun compileMain(args: Array): Boolean { quietAssembler == true, asmListfile == true, experimentalCodegen == true, - keepIR == true, compilationTarget, evalStackAddr, processedSymbols, diff --git a/compiler/src/prog8/compiler/Compiler.kt b/compiler/src/prog8/compiler/Compiler.kt index 243c1ea6e..87f07f19c 100644 --- a/compiler/src/prog8/compiler/Compiler.kt +++ b/compiler/src/prog8/compiler/Compiler.kt @@ -38,7 +38,6 @@ class CompilerArguments(val filepath: Path, val quietAssembler: Boolean, val asmListfile: Boolean, val experimentalCodegen: Boolean, - val keepIR: Boolean, val compilationTarget: String, val evalStackBaseAddress: UInt?, val symbolDefs: Map, @@ -81,7 +80,6 @@ fun compileProgram(args: CompilerArguments): CompilationResult? { asmQuiet = args.quietAssembler asmListfile = args.asmListfile experimentalCodegen = args.experimentalCodegen - keepIR = args.keepIR evalStackBaseAddress = args.evalStackBaseAddress outputDir = args.outputDir.normalize() symbolDefs = args.symbolDefs diff --git a/compiler/test/TestCompilerOnExamples.kt b/compiler/test/TestCompilerOnExamples.kt index ff887eb31..1ac5fd6c9 100644 --- a/compiler/test/TestCompilerOnExamples.kt +++ b/compiler/test/TestCompilerOnExamples.kt @@ -33,7 +33,6 @@ private fun compileTheThing(filepath: Path, optimize: Boolean, target: ICompilat quietAssembler = true, asmListfile = false, experimentalCodegen = false, - keepIR = false, compilationTarget = target.name, evalStackBaseAddress = null, symbolDefs = emptyMap(), @@ -189,8 +188,8 @@ class TestCompilerOnExamplesVirtual: FunSpec({ val (displayName, filepath) = prepareTestFiles(it, false, target) test(displayName) { val src = filepath.readText() - compileText(target, false, src, writeAssembly = true, keepIR=false) shouldNotBe null - compileText(target, false, src, writeAssembly = true, keepIR=true) shouldNotBe null + compileText(target, false, src, writeAssembly = true) shouldNotBe null + compileText(target, false, src, writeAssembly = true) shouldNotBe null } } }) diff --git a/compiler/test/TestCompilerOptionLibdirs.kt b/compiler/test/TestCompilerOptionLibdirs.kt index ed408c777..bf7b74ef1 100644 --- a/compiler/test/TestCompilerOptionLibdirs.kt +++ b/compiler/test/TestCompilerOptionLibdirs.kt @@ -50,7 +50,6 @@ class TestCompilerOptionSourcedirs: FunSpec({ quietAssembler = true, asmListfile = false, experimentalCodegen = false, - keepIR = false, compilationTarget = Cx16Target.NAME, evalStackBaseAddress = null, symbolDefs = emptyMap(), diff --git a/compiler/test/helpers/compileXyz.kt b/compiler/test/helpers/compileXyz.kt index 0efb47dc2..82d00ae71 100644 --- a/compiler/test/helpers/compileXyz.kt +++ b/compiler/test/helpers/compileXyz.kt @@ -17,7 +17,6 @@ internal fun compileFile( outputDir: Path = prog8tests.helpers.outputDir, errors: IErrorReporter? = null, writeAssembly: Boolean = true, - keepIR: Boolean = true, optFloatExpr: Boolean = true ) : CompilationResult? { val filepath = fileDir.resolve(fileName) @@ -32,7 +31,6 @@ internal fun compileFile( quietAssembler = true, asmListfile = false, experimentalCodegen = false, - keepIR = keepIR, platform.name, evalStackBaseAddress = null, symbolDefs = emptyMap(), @@ -53,12 +51,11 @@ internal fun compileText( sourceText: String, errors: IErrorReporter? = null, writeAssembly: Boolean = true, - keepIR: Boolean = true, optFloatExpr: Boolean = true ) : CompilationResult? { val filePath = outputDir.resolve("on_the_fly_test_" + sourceText.hashCode().toUInt().toString(16) + ".p8") // we don't assumeNotExists(filePath) - should be ok to just overwrite it filePath.toFile().writeText(sourceText) return compileFile(platform, optimize, filePath.parent, filePath.name, - errors=errors, writeAssembly=writeAssembly, optFloatExpr = optFloatExpr, keepIR=keepIR) + errors=errors, writeAssembly=writeAssembly, optFloatExpr = optFloatExpr) } diff --git a/compiler/test/vm/TestCompilerVirtual.kt b/compiler/test/vm/TestCompilerVirtual.kt index 4cdbef3bc..318d59b91 100644 --- a/compiler/test/vm/TestCompilerVirtual.kt +++ b/compiler/test/vm/TestCompilerVirtual.kt @@ -50,7 +50,7 @@ main { } }""" val othertarget = Cx16Target() - compileText(othertarget, true, src, writeAssembly = true, keepIR=true) shouldNotBe null + compileText(othertarget, true, src, writeAssembly = true) shouldNotBe null val target = VMTarget() val result = compileText(target, true, src, writeAssembly = true)!! val virtfile = result.compilationOptions.outputDir.resolve(result.program.name + ".p8ir") @@ -162,7 +162,7 @@ skipLABEL: } }""" val othertarget = Cx16Target() - compileText(othertarget, true, src, writeAssembly = true, keepIR=true) shouldNotBe null + compileText(othertarget, true, src, writeAssembly = true) shouldNotBe null val target = VMTarget() val result = compileText(target, true, src, writeAssembly = true)!! val virtfile = result.compilationOptions.outputDir.resolve(result.program.name + ".p8ir") @@ -205,7 +205,7 @@ main { } }""" val othertarget = Cx16Target() - compileText(othertarget, true, src, writeAssembly = true, keepIR=true) shouldNotBe null + compileText(othertarget, true, src, writeAssembly = true) shouldNotBe null val target = VMTarget() val result = compileText(target, false, src, writeAssembly = true)!! @@ -232,7 +232,7 @@ main { } }""" val othertarget = Cx16Target() - compileText(othertarget, true, src, writeAssembly = true, keepIR=true) shouldNotBe null + compileText(othertarget, true, src, writeAssembly = true) shouldNotBe null val target = VMTarget() val result = compileText(target, false, src, writeAssembly = true)!! @@ -260,7 +260,7 @@ mylabel: """ val othertarget = Cx16Target() - compileText(othertarget, true, src, writeAssembly = true, keepIR=true) shouldNotBe null + compileText(othertarget, true, src, writeAssembly = true) shouldNotBe null val target = VMTarget() val result = compileText(target, false, src, writeAssembly = true)!! diff --git a/docs/source/building.rst b/docs/source/building.rst index 9dc602fb5..d6e32c3e4 100644 --- a/docs/source/building.rst +++ b/docs/source/building.rst @@ -166,9 +166,6 @@ One or more .p8 module files ``-asmlist`` Generate an assembler listing file as well. -``-keepIR`` - Keep the IR code in a file (for targets that use it). - ``-expericodegen`` Use experimental code generation backend (*incomplete*). diff --git a/httpCompilerService/src/prog8/http/TestHttp.kt b/httpCompilerService/src/prog8/http/TestHttp.kt index 8cddf3db7..7d2b320ed 100644 --- a/httpCompilerService/src/prog8/http/TestHttp.kt +++ b/httpCompilerService/src/prog8/http/TestHttp.kt @@ -42,8 +42,7 @@ class RequestParser : Take { symbolDefs = emptyMap(), quietAssembler = false, asmListfile = false, - experimentalCodegen = false, - keepIR = false + experimentalCodegen = false ) val compilationResult = compileProgram(args) return RsJson(Jsonding())