diff --git a/source/tlang/commandline/commands.d b/source/tlang/commandline/commands.d index dcd27a6f..469692ad 100644 --- a/source/tlang/commandline/commands.d +++ b/source/tlang/commandline/commands.d @@ -59,7 +59,7 @@ mixin template EmitBase() { @ArgGroup("Emit", "Options pertaining to the code emitter") { - @ArgNamed("symbol-mapper|sm", "The symbol mapping technique to use") + @ArgNamed("symbol-mapper|sm", "The symbol mapping technique to use for DGen (C emitter)") @(ArgConfig.optional) SymbolMappingTechnique symbolTechnique = SymbolMappingTechnique.HASHMAPPER; @@ -75,6 +75,10 @@ mixin template EmitBase() @(ArgConfig.optional) bool entrypointTestEmit = true; // TODO: Change this later to `false` of course + @ArgNamed("preinlineArguments|pia", "Whether or not to preinline function call arguments in DGen (C emitter)") + @(ArgConfig.optional) + bool preinlineArguments = false; // TODO: Change this later to `true` of course + @ArgNamed("library-link|ll", "Paths to any object files to ,ink in during the linking phase") @(ArgConfig.optional) @(ArgConfig.aggregate) @@ -84,7 +88,7 @@ mixin template EmitBase() void EmitBaseInit(Compiler compiler) { // Set the symbol mapper technique - compiler.getConfig().addConfig(ConfigEntry("emit:mapper", symbolTechnique)); + compiler.getConfig().addConfig(ConfigEntry("dgen:mapper", symbolTechnique)); // Set whether pretty-printed code should be generated compiler.getConfig().addConfig(ConfigEntry("dgen:pretty_code", prettyPrintCodeGen)); @@ -92,6 +96,9 @@ mixin template EmitBase() // Set whether or not to enable the entry point testing code compiler.getConfig().addConfig(ConfigEntry("dgen:emit_entrypoint_test", entrypointTestEmit)); + // Set whether or not to enable pre-inlining of function call arguments in DGen + compiler.getConfig().addConfig(ConfigEntry("dgen:preinline_args", preinlineArguments)); + // Set the paths to the object files to link in compiler.getConfig().addConfig(ConfigEntry("linker:link_files", bruh)); } diff --git a/source/tlang/compiler/configuration.d b/source/tlang/compiler/configuration.d index 310de283..28da661b 100644 --- a/source/tlang/compiler/configuration.d +++ b/source/tlang/compiler/configuration.d @@ -200,8 +200,8 @@ public final class CompilerConfiguration /* Generate a fresh new config */ CompilerConfiguration config = new CompilerConfiguration(); - /* Enable Behaviour-C fixes */ - config.addConfig(ConfigEntry("behavec:preinline_args", true)); + /* Enable Behaviour-C fixes (TODO: This should be changed to true before release) */ + config.addConfig(ConfigEntry("dgen:preinline_args", false)); /* Enable pretty code generation for DGen */ config.addConfig(ConfigEntry("dgen:pretty_code", true)); @@ -209,8 +209,8 @@ public final class CompilerConfiguration /* Enable entry point test generation for DGen */ config.addConfig(ConfigEntry("dgen:emit_entrypoint_test", true)); - /* Set the mapping to hashing of entity names (TODO: This should be changed before release) */ - config.addConfig(ConfigEntry("emit:mapper", "hashmapper")); + /* Set the mapping to hashing of entity names for DGen (TODO: This should be changed before release) */ + config.addConfig(ConfigEntry("dgen:mapper", "hashmapper")); /** * Configure, at compile time, the system type aliases diff --git a/source/tlang/compiler/core.d b/source/tlang/compiler/core.d index 84d7049f..2288be51 100644 --- a/source/tlang/compiler/core.d +++ b/source/tlang/compiler/core.d @@ -204,13 +204,13 @@ public class Compiler throw new CompilerException(CompilerError.TYPECHECK_NOT_YET_PERFORMED); } - if(!config.hasConfig("emit:mapper")) + if(!config.hasConfig("dgen:mapper")) { throw new CompilerException(CompilerError.CONFIG_ERROR, "Missing a symbol mapper"); } SymbolMapper mapper; - string mapperType = config.getConfig("emit:mapper").getText(); + string mapperType = config.getConfig("dgen:mapper").getText(); if(cmp(mapperType, "hashmapper") == 0) {