aboutsummaryrefslogtreecommitdiff
path: root/src/ir.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2019-03-15 16:39:49 +0000
committergingerBill <bill@gingerbill.org>2019-03-15 16:39:49 +0000
commit885c5dc8b75dd88d376627195a5468d12264bcc5 (patch)
treee7a3c00409420fb8fca1728296ce6e9320923150 /src/ir.cpp
parent394baa9ddd0e2e0b6c5d69232a52785aea73ed22 (diff)
Fix issue with `deferred_*` attributes
Diffstat (limited to 'src/ir.cpp')
-rw-r--r--src/ir.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/ir.cpp b/src/ir.cpp
index 6d44282be..6631711b5 100644
--- a/src/ir.cpp
+++ b/src/ir.cpp
@@ -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);