- Now lookup `dgen:mapper` instead of `emit:mapper`

Configuration

- Now set `dgen:mapper` to `hashmapper` instead of `emit:mapper`
- Added `dgen_preinline_args` and set it to `false`

Commands

- Updated description for `symbol-mapper`/`sm` flag
- The `symbol-mapper`/`sm` flag now affects the `dgen:mapper` entry instead of the `emit:mapper` entry
- Transfer the flag value of `preinlineArguments`/`pia` to the `dgen:preinline_args` entry
This commit is contained in:
Tristan B. Velloza Kildaire 2023-08-16 15:51:53 +02:00
parent e5b0f4e0a1
commit fd31024a07
3 changed files with 15 additions and 8 deletions

View File

@ -59,7 +59,7 @@ mixin template EmitBase()
{ {
@ArgGroup("Emit", "Options pertaining to the code emitter") @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) @(ArgConfig.optional)
SymbolMappingTechnique symbolTechnique = SymbolMappingTechnique.HASHMAPPER; SymbolMappingTechnique symbolTechnique = SymbolMappingTechnique.HASHMAPPER;
@ -75,6 +75,10 @@ mixin template EmitBase()
@(ArgConfig.optional) @(ArgConfig.optional)
bool entrypointTestEmit = true; // TODO: Change this later to `false` of course 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") @ArgNamed("library-link|ll", "Paths to any object files to ,ink in during the linking phase")
@(ArgConfig.optional) @(ArgConfig.optional)
@(ArgConfig.aggregate) @(ArgConfig.aggregate)
@ -84,7 +88,7 @@ mixin template EmitBase()
void EmitBaseInit(Compiler compiler) void EmitBaseInit(Compiler compiler)
{ {
// Set the symbol mapper technique // 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 // Set whether pretty-printed code should be generated
compiler.getConfig().addConfig(ConfigEntry("dgen:pretty_code", prettyPrintCodeGen)); 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 // Set whether or not to enable the entry point testing code
compiler.getConfig().addConfig(ConfigEntry("dgen:emit_entrypoint_test", entrypointTestEmit)); 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 // Set the paths to the object files to link in
compiler.getConfig().addConfig(ConfigEntry("linker:link_files", bruh)); compiler.getConfig().addConfig(ConfigEntry("linker:link_files", bruh));
} }

View File

@ -200,8 +200,8 @@ public final class CompilerConfiguration
/* Generate a fresh new config */ /* Generate a fresh new config */
CompilerConfiguration config = new CompilerConfiguration(); CompilerConfiguration config = new CompilerConfiguration();
/* Enable Behaviour-C fixes */ /* Enable Behaviour-C fixes (TODO: This should be changed to true before release) */
config.addConfig(ConfigEntry("behavec:preinline_args", true)); config.addConfig(ConfigEntry("dgen:preinline_args", false));
/* Enable pretty code generation for DGen */ /* Enable pretty code generation for DGen */
config.addConfig(ConfigEntry("dgen:pretty_code", true)); config.addConfig(ConfigEntry("dgen:pretty_code", true));
@ -209,8 +209,8 @@ public final class CompilerConfiguration
/* Enable entry point test generation for DGen */ /* Enable entry point test generation for DGen */
config.addConfig(ConfigEntry("dgen:emit_entrypoint_test", true)); config.addConfig(ConfigEntry("dgen:emit_entrypoint_test", true));
/* Set the mapping to hashing of entity names (TODO: This should be changed before release) */ /* Set the mapping to hashing of entity names for DGen (TODO: This should be changed before release) */
config.addConfig(ConfigEntry("emit:mapper", "hashmapper")); config.addConfig(ConfigEntry("dgen:mapper", "hashmapper"));
/** /**
* Configure, at compile time, the system type aliases * Configure, at compile time, the system type aliases

View File

@ -204,13 +204,13 @@ public class Compiler
throw new CompilerException(CompilerError.TYPECHECK_NOT_YET_PERFORMED); 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"); throw new CompilerException(CompilerError.CONFIG_ERROR, "Missing a symbol mapper");
} }
SymbolMapper mapper; SymbolMapper mapper;
string mapperType = config.getConfig("emit:mapper").getText(); string mapperType = config.getConfig("dgen:mapper").getText();
if(cmp(mapperType, "hashmapper") == 0) if(cmp(mapperType, "hashmapper") == 0)
{ {