mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 15:48:51 +00:00
Fix general IR parameter case
This commit is contained in:
+9
-7
@@ -2108,14 +2108,16 @@ Type *type_to_abi_compat_param_type(gbAllocator a, Type *original_type, ProcCall
|
|||||||
if (8*size > 16) {
|
if (8*size > 16) {
|
||||||
new_type = alloc_type_pointer(original_type);
|
new_type = alloc_type_pointer(original_type);
|
||||||
} else if (build_context.ODIN_ARCH == "amd64") {
|
} else if (build_context.ODIN_ARCH == "amd64") {
|
||||||
// NOTE(bill): System V AMD64 ABI
|
if (is_type_struct(bt)) {
|
||||||
if (bt->Struct.is_raw_union) {
|
// NOTE(bill): System V AMD64 ABI
|
||||||
// TODO(bill): Handle raw union correctly for
|
if (bt->Struct.is_raw_union) {
|
||||||
break;
|
// TODO(bill): Handle raw union correctly for
|
||||||
}
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
new_type = handle_struct_system_v_amd64_abi_type(bt);
|
new_type = handle_struct_system_v_amd64_abi_type(bt);
|
||||||
return new_type;
|
return new_type;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|||||||
+4
-1
@@ -3061,8 +3061,8 @@ irValue *ir_emit_call(irProcedure *p, irValue *value, Array<irValue *> const &ar
|
|||||||
Type *new_type = pt->Proc.abi_compat_params[i];
|
Type *new_type = pt->Proc.abi_compat_params[i];
|
||||||
Type *arg_type = ir_type(args[i]);
|
Type *arg_type = ir_type(args[i]);
|
||||||
if (are_types_identical(arg_type, new_type)) {
|
if (are_types_identical(arg_type, new_type)) {
|
||||||
array_add(&processed_args, args[i]);
|
|
||||||
// NOTE(bill): Done
|
// NOTE(bill): Done
|
||||||
|
array_add(&processed_args, args[i]);
|
||||||
} else if (!are_types_identical(original_type, new_type)) {
|
} else if (!are_types_identical(original_type, new_type)) {
|
||||||
if (is_type_pointer(new_type) && !is_type_pointer(original_type)) {
|
if (is_type_pointer(new_type) && !is_type_pointer(original_type)) {
|
||||||
if (e->flags&EntityFlag_ImplicitReference) {
|
if (e->flags&EntityFlag_ImplicitReference) {
|
||||||
@@ -3085,6 +3085,9 @@ irValue *ir_emit_call(irProcedure *p, irValue *value, Array<irValue *> const &ar
|
|||||||
array_add(&processed_args, xx);
|
array_add(&processed_args, xx);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
irValue *x = ir_emit_conv(p, args[i], new_type);
|
||||||
|
array_add(&processed_args, x);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user