Fix issue with deferred_* attributes

This commit is contained in:
gingerBill
2019-03-15 16:39:49 +00:00
parent 394baa9ddd
commit 885c5dc8b7
2 changed files with 10 additions and 12 deletions
+6 -8
View File
@@ -2972,18 +2972,16 @@ irValue *ir_emit_call(irProcedure *p, irValue *value, Array<irValue *> args, Pro
Type *original_type = e->type;
Type *new_type = pt->Proc.abi_compat_params[i];
if (!are_types_identical(original_type, new_type)) {
Type *arg_type = ir_type(args[i]);
Type *arg_type = ir_type(args[i]);
if (are_types_identical(arg_type, new_type)) {
// NOTE(bill): Done
} else if (!are_types_identical(original_type, new_type)) {
if (is_type_pointer(new_type) && !is_type_pointer(original_type)) {
if (e->flags&EntityFlag_Value) {
args[i] = ir_address_from_load_or_generate_local(p, args[i]);
} else {
if (is_type_pointer(arg_type)) {
// args[i] = ir_copy_value_to_ptr(p, ir_emit_load(p, args[i]), original_type, 16);
} else {
args[i] = ir_copy_value_to_ptr(p, args[i], original_type, 16);
}
} else if (!is_type_pointer(arg_type)) {
args[i] = ir_copy_value_to_ptr(p, args[i], original_type, 16);
}
} else if (is_type_integer(new_type)) {
args[i] = ir_emit_transmute(p, args[i], new_type);