Compare commits

..

1 Commits

Author SHA1 Message Date
03aa714a51 Compile the compiler
All checks were successful
CI / ci (Release, ubuntu-latest) (pull_request) Successful in 5m55s
CI / ci (RelWithDebInfo, ubuntu-latest) (pull_request) Successful in 5m58s
CI / ci (MinSizeRel, ubuntu-latest) (pull_request) Successful in 6m0s
CI / ci (Debug, ubuntu-latest) (pull_request) Successful in 18m14s
CI / ci (Release, ubuntu-latest) (push) Successful in 5m54s
CI / ci (RelWithDebInfo, ubuntu-latest) (push) Successful in 5m56s
CI / ci (MinSizeRel, ubuntu-latest) (push) Successful in 5m58s
CI / ci (Debug, ubuntu-latest) (push) Successful in 18m19s
2025-06-20 20:18:35 -06:00
2 changed files with 8 additions and 12 deletions

View File

@ -10699,7 +10699,7 @@ analyze_type = fn (module: &Module, value: &Value, expected_type: &Type, analysi
>current_function = get_current_function(module);
>old_alloca_insertion_point = current_function.variable.storage.content.function.llvm.alloca_insertion_point;
current_function.variable.storage.content.function.llvm.alloca_insertion_point = LLVMBuildAlloca(module.llvm.builder, u32_type.llvm.abi, "alloca_insertion_point");
current_function.variable.storage.content.function.llvm.alloca_insertion_point = LLVMBuildAlloca(module.llvm.builder, u32_type.llvm.abi, "alloca.insertion.point");
>alloca = create_alloca(module, {
.type = string_type,
@ -11927,7 +11927,7 @@ analyze_type = fn (module: &Module, value: &Value, expected_type: &Type, analysi
>u32_type = uint32(module);
resolve_type_in_place(module, u32_type);
current_function.variable.storage.content.function.llvm.alloca_insertion_point = LLVMBuildAlloca(module.llvm.builder, u32_type.llvm.abi, "alloca_insertion_point");
current_function.variable.storage.content.function.llvm.alloca_insertion_point = LLVMBuildAlloca(module.llvm.builder, u32_type.llvm.abi, "alloca.insertion.point");
>arguments: [2]&LLVMValue = undefined;
LLVMGetParams(llvm_function, &arguments[0]);
@ -17575,7 +17575,7 @@ emit = fn (module: &Module) void
>u32_type = uint32(module);
resolve_type_in_place(module, u32_type);
global.variable.storage.content.function.llvm.alloca_insertion_point = LLVMBuildAlloca(module.llvm.builder, u32_type.llvm.abi, "alloca_insertion_point");
global.variable.storage.content.function.llvm.alloca_insertion_point = LLVMBuildAlloca(module.llvm.builder, u32_type.llvm.abi, "alloca.insertion.point");
>return_abi = &function_type.abi.return_abi;
switch (return_abi.flags.kind)

View File

@ -2809,6 +2809,7 @@ fn Type* get_build_mode_enum(Module* module)
string_literal("aggressively_optimize_for_speed"),
string_literal("aggressively_optimize_for_size"),
};
static_assert(array_length(enum_names) == (u64)BuildMode::count);
auto enum_fields = arena_allocate<EnumField>(module->arena, array_length(enum_names));
@ -2823,7 +2824,7 @@ fn Type* get_build_mode_enum(Module* module)
field_value += 1;
}
auto backing_type = integer_type(module, { .bit_count = array_length(enum_names) - 1, .is_signed = false });
auto backing_type = integer_type(module, { .bit_count = (u32)BuildMode::count, .is_signed = false });
result = type_allocate_init(module, {
.enumerator = {
@ -3093,7 +3094,7 @@ fn void analyze_type(Module* module, Value* value, Type* expected_type, TypeAnal
resolve_type_in_place(module, u32_type);
auto current_function = get_current_function(module);
auto old_alloca_insertion_point = current_function->variable.storage->function.llvm.alloca_insertion_point;
current_function->variable.storage->function.llvm.alloca_insertion_point = LLVMBuildAlloca(module->llvm.builder, u32_type->llvm.abi, "alloca_insert_point");
current_function->variable.storage->function.llvm.alloca_insertion_point = LLVMBuildAlloca(module->llvm.builder, u32_type->llvm.abi, "alloca.insertion.point");
auto alloca = create_alloca(module, {
.type = string_type,
@ -4303,7 +4304,7 @@ fn void analyze_type(Module* module, Value* value, Type* expected_type, TypeAnal
auto old_alloca_insertion_point = current_function->variable.storage->function.llvm.alloca_insertion_point;
auto u32_type = uint32(module);
resolve_type_in_place(module, u32_type);
current_function->variable.storage->function.llvm.alloca_insertion_point = LLVMBuildAlloca(module->llvm.builder, u32_type->llvm.abi, "alloca_insert_point");
current_function->variable.storage->function.llvm.alloca_insertion_point = LLVMBuildAlloca(module->llvm.builder, u32_type->llvm.abi, "alloca.insertion.point");
LLVMValueRef arguments[2];
LLVMGetParams(llvm_function, arguments);
@ -7700,11 +7701,6 @@ fn void emit_value(Module* module, Value* value, TypeKind type_kind, bool expect
{
auto enum_type = array_type->enum_array.enum_type;
assert(enum_type->id == TypeId::enumerator);
auto enumerator_size = get_bit_size(enum_type->enumerator.backing_type);
if (enumerator_size != 64)
{
llvm_index = LLVMBuildIntCast2(module->llvm.builder, llvm_index, u64_llvm, false, "");
}
element_type = array_type->enum_array.element_type;
} break;
default: unreachable();
@ -9607,7 +9603,7 @@ void emit(Module* module)
auto u32_type = uint32(module);
resolve_type_in_place(module, u32_type);
global->variable.storage->function.llvm.alloca_insertion_point = LLVMBuildAlloca(module->llvm.builder, u32_type->llvm.abi, "alloca_insert_point");
global->variable.storage->function.llvm.alloca_insertion_point = LLVMBuildAlloca(module->llvm.builder, u32_type->llvm.abi, "alloca.insertion.point");
auto return_abi_kind = function_type->abi.return_abi.flags.kind;
switch (return_abi_kind)