aboutsummaryrefslogtreecommitdiff
path: root/src/ir.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2019-07-27 10:20:11 +0100
committergingerBill <bill@gingerbill.org>2019-07-27 10:20:11 +0100
commitf3bffb98101e3a584c8a5e8a6389c608ffe64c40 (patch)
tree1de3f067a441934fc7d5ed5f69e6171cae7443d9 /src/ir.cpp
parent540730c0bedb7f6e107d2ed01c804f897074419d (diff)
Improvement to the Odin calling conventions to pass certain things by "implicit reference" (`const &` in C++)
Diffstat (limited to 'src/ir.cpp')
-rw-r--r--src/ir.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/ir.cpp b/src/ir.cpp
index 82f9fa755..8c5dcb963 100644
--- a/src/ir.cpp
+++ b/src/ir.cpp
@@ -3004,9 +3004,8 @@ irValue *ir_emit_call(irProcedure *p, irValue *value, Array<irValue *> args, Pro
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) {
+ if (e->flags&EntityFlag_ImplicitReference) {
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, args[i], original_type, 16);