Pass cpu model option
Some checks failed
CI / ci (Release, ubuntu-latest) (pull_request) Successful in 35m16s
CI / ci (Debug, ubuntu-latest) (pull_request) Successful in 59m31s
CI / release (ubuntu-latest) (pull_request) Successful in 1s
CI / ci (Release, ubuntu-latest) (push) Failing after 31m30s
CI / ci (Debug, ubuntu-latest) (push) Failing after 57m10s
CI / release (ubuntu-latest) (push) Has been skipped

This commit is contained in:
David Gonzalez Martin 2025-06-22 14:08:24 -06:00
parent ad79740b4d
commit a6cd3bf713
2 changed files with 39 additions and 2 deletions

View File

@ -18665,6 +18665,7 @@ names: [_][]u8 =
>build_mode: BuildMode = .debug_none; >build_mode: BuildMode = .debug_none;
>has_debug_info: u1 = 1; >has_debug_info: u1 = 1;
>is_host_cpu_model: u1 = 1;
if (argument_count >= 4) if (argument_count >= 4)
{ {
@ -18693,6 +18694,23 @@ names: [_][]u8 =
} }
} }
if (argument_count >= 6)
{
>is_host_cpu_model_string = c_string_to_slice(arguments[5]);
if (string_equal(is_host_cpu_model_string, "true"))
{
is_host_cpu_model = 1;
}
else if (string_equal(is_host_cpu_model_string, "false"))
{
is_host_cpu_model = 0;
}
else
{
return 1;
}
}
>relative_file_path_pointer = arguments[2]; >relative_file_path_pointer = arguments[2];
if (!relative_file_path_pointer) if (!relative_file_path_pointer)
{ {
@ -18704,7 +18722,7 @@ names: [_][]u8 =
compile_file(arena, { compile_file(arena, {
.relative_file_path = relative_file_path, .relative_file_path = relative_file_path,
.build_mode = build_mode, .build_mode = build_mode,
.host_cpu_model = 0, .host_cpu_model = is_host_cpu_model,
.has_debug_info = has_debug_info, .has_debug_info = has_debug_info,
.silent = 0, .silent = 0,
}, envp); }, envp);

View File

@ -535,6 +535,7 @@ void entry_point(Slice<char* const> arguments, Slice<char* const> envp)
auto build_mode = BuildMode::debug_none; auto build_mode = BuildMode::debug_none;
auto has_debug_info = true; auto has_debug_info = true;
auto is_host_cpu_model = true;
if (arguments.length >= 4) if (arguments.length >= 4)
{ {
@ -583,12 +584,30 @@ void entry_point(Slice<char* const> arguments, Slice<char* const> envp)
} }
} }
if (arguments.length >= 6)
{
auto is_host_cpu_model_string = c_string_to_slice(arguments[5]);
if (is_host_cpu_model_string.equal(string_literal("true")))
{
is_host_cpu_model = true;
}
else if (is_host_cpu_model_string.equal(string_literal("false")))
{
is_host_cpu_model = false;
}
else
{
bb_fail_with_message(string_literal("Wrong value for is_host_cpu_model\n"));
}
}
auto relative_file_path = c_string_to_slice(arguments[2]); auto relative_file_path = c_string_to_slice(arguments[2]);
compile_file(arena, { compile_file(arena, {
.relative_file_path = relative_file_path, .relative_file_path = relative_file_path,
.build_mode = build_mode, .build_mode = build_mode,
.has_debug_info = has_debug_info, .has_debug_info = has_debug_info,
.host_cpu_model = is_host_cpu_model,
.silent = false, .silent = false,
}); });
} break; } break;
@ -601,7 +620,6 @@ void entry_point(Slice<char* const> arguments, Slice<char* const> envp)
} }
bool has_debug_info_array[] = {true, false}; bool has_debug_info_array[] = {true, false};
bool is_host_cpu_model_array[] = {true, false};
for (auto name: names) for (auto name: names)
{ {
@ -649,6 +667,7 @@ void entry_point(Slice<char* const> arguments, Slice<char* const> envp)
.relative_file_path = string_literal("src/compiler.bbb"), .relative_file_path = string_literal("src/compiler.bbb"),
.build_mode = compiler_build_mode, .build_mode = compiler_build_mode,
.has_debug_info = compiler_has_debug_info, .has_debug_info = compiler_has_debug_info,
.host_cpu_model = true,
.silent = true, .silent = true,
}); });