Compare commits
1 Commits
03aa714a51
...
c7056f2520
Author | SHA1 | Date | |
---|---|---|---|
c7056f2520 |
@ -10699,7 +10699,7 @@ analyze_type = fn (module: &Module, value: &Value, expected_type: &Type, analysi
|
|||||||
|
|
||||||
>current_function = get_current_function(module);
|
>current_function = get_current_function(module);
|
||||||
>old_alloca_insertion_point = current_function.variable.storage.content.function.llvm.alloca_insertion_point;
|
>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, {
|
>alloca = create_alloca(module, {
|
||||||
.type = string_type,
|
.type = string_type,
|
||||||
@ -11927,7 +11927,7 @@ analyze_type = fn (module: &Module, value: &Value, expected_type: &Type, analysi
|
|||||||
>u32_type = uint32(module);
|
>u32_type = uint32(module);
|
||||||
resolve_type_in_place(module, u32_type);
|
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;
|
>arguments: [2]&LLVMValue = undefined;
|
||||||
LLVMGetParams(llvm_function, &arguments[0]);
|
LLVMGetParams(llvm_function, &arguments[0]);
|
||||||
@ -17575,7 +17575,7 @@ emit = fn (module: &Module) void
|
|||||||
>u32_type = uint32(module);
|
>u32_type = uint32(module);
|
||||||
resolve_type_in_place(module, u32_type);
|
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;
|
>return_abi = &function_type.abi.return_abi;
|
||||||
switch (return_abi.flags.kind)
|
switch (return_abi.flags.kind)
|
||||||
|
@ -2809,7 +2809,6 @@ fn Type* get_build_mode_enum(Module* module)
|
|||||||
string_literal("aggressively_optimize_for_speed"),
|
string_literal("aggressively_optimize_for_speed"),
|
||||||
string_literal("aggressively_optimize_for_size"),
|
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));
|
auto enum_fields = arena_allocate<EnumField>(module->arena, array_length(enum_names));
|
||||||
|
|
||||||
@ -2824,7 +2823,7 @@ fn Type* get_build_mode_enum(Module* module)
|
|||||||
field_value += 1;
|
field_value += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto backing_type = integer_type(module, { .bit_count = (u32)BuildMode::count, .is_signed = false });
|
auto backing_type = integer_type(module, { .bit_count = array_length(enum_names) - 1, .is_signed = false });
|
||||||
|
|
||||||
result = type_allocate_init(module, {
|
result = type_allocate_init(module, {
|
||||||
.enumerator = {
|
.enumerator = {
|
||||||
@ -3094,7 +3093,7 @@ fn void analyze_type(Module* module, Value* value, Type* expected_type, TypeAnal
|
|||||||
resolve_type_in_place(module, u32_type);
|
resolve_type_in_place(module, u32_type);
|
||||||
auto current_function = get_current_function(module);
|
auto current_function = get_current_function(module);
|
||||||
auto old_alloca_insertion_point = current_function->variable.storage->function.llvm.alloca_insertion_point;
|
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.insertion.point");
|
current_function->variable.storage->function.llvm.alloca_insertion_point = LLVMBuildAlloca(module->llvm.builder, u32_type->llvm.abi, "alloca_insert_point");
|
||||||
|
|
||||||
auto alloca = create_alloca(module, {
|
auto alloca = create_alloca(module, {
|
||||||
.type = string_type,
|
.type = string_type,
|
||||||
@ -4304,7 +4303,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 old_alloca_insertion_point = current_function->variable.storage->function.llvm.alloca_insertion_point;
|
||||||
auto u32_type = uint32(module);
|
auto u32_type = uint32(module);
|
||||||
resolve_type_in_place(module, u32_type);
|
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.insertion.point");
|
current_function->variable.storage->function.llvm.alloca_insertion_point = LLVMBuildAlloca(module->llvm.builder, u32_type->llvm.abi, "alloca_insert_point");
|
||||||
|
|
||||||
LLVMValueRef arguments[2];
|
LLVMValueRef arguments[2];
|
||||||
LLVMGetParams(llvm_function, arguments);
|
LLVMGetParams(llvm_function, arguments);
|
||||||
@ -7701,6 +7700,11 @@ fn void emit_value(Module* module, Value* value, TypeKind type_kind, bool expect
|
|||||||
{
|
{
|
||||||
auto enum_type = array_type->enum_array.enum_type;
|
auto enum_type = array_type->enum_array.enum_type;
|
||||||
assert(enum_type->id == TypeId::enumerator);
|
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;
|
element_type = array_type->enum_array.element_type;
|
||||||
} break;
|
} break;
|
||||||
default: unreachable();
|
default: unreachable();
|
||||||
@ -9603,7 +9607,7 @@ void emit(Module* module)
|
|||||||
|
|
||||||
auto u32_type = uint32(module);
|
auto u32_type = uint32(module);
|
||||||
resolve_type_in_place(module, u32_type);
|
resolve_type_in_place(module, u32_type);
|
||||||
global->variable.storage->function.llvm.alloca_insertion_point = LLVMBuildAlloca(module->llvm.builder, u32_type->llvm.abi, "alloca.insertion.point");
|
global->variable.storage->function.llvm.alloca_insertion_point = LLVMBuildAlloca(module->llvm.builder, u32_type->llvm.abi, "alloca_insert_point");
|
||||||
|
|
||||||
auto return_abi_kind = function_type->abi.return_abi.flags.kind;
|
auto return_abi_kind = function_type->abi.return_abi.flags.kind;
|
||||||
switch (return_abi_kind)
|
switch (return_abi_kind)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user