1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2024-11-22 16:33:48 +00:00

Added commandline option -struct_model to specify the struct model. Closes #707

This commit is contained in:
jespergravgaard 2021-08-11 00:25:57 +02:00
parent 8a38c2a887
commit 650592fc66

View File

@ -176,6 +176,9 @@ public class KickC implements Callable<Integer> {
@CommandLine.Option(names = {"-var_model"}, description = "Configure variable optimization/memory area. Default is ssa_zp. See #pragma var_model")
private String varModel = null;
@CommandLine.Option(names = {"-struct_model"}, description = "Configure struct model (Values: 'unwind' or 'classic'). Default is unwind. See #pragma struct_model")
private String structModel = null;
@CommandLine.Option(names = {"-calling"}, description = "Configure calling convention. Default is __phicall. See #pragma calling")
private String calling = null;
@ -327,6 +330,11 @@ public class KickC implements Callable<Integer> {
}
}
if(structModel != null) {
boolean isClassic = structModel.equalsIgnoreCase("classic");
program.getTargetPlatform().getVariableBuilderConfig().setStructModelClassic(isClassic);
}
if(calling != null) {
Procedure.CallingConvention callingConvention = Procedure.CallingConvention.getCallingConvension(calling);
if(callingConvention == null) {