aboutsummaryrefslogtreecommitdiff
path: root/src/llvm_backend_proc.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2024-04-06 16:59:07 +0100
committergingerBill <bill@gingerbill.org>2024-04-06 16:59:07 +0100
commit83d3bc74b07eeffc2339a39540aac3b4a99aa3e5 (patch)
treeb1546a3793d14f4f4404c77bc1a1dabdbfda98e2 /src/llvm_backend_proc.cpp
parentfbf01543d1762875d9607f5b4dbd56a8c6f3aa2e (diff)
parent8a98ee800a74567af8ad29451ce5800b732a058c (diff)
Merge branch 'master' of https://github.com/odin-lang/Odin
Diffstat (limited to 'src/llvm_backend_proc.cpp')
-rw-r--r--src/llvm_backend_proc.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/llvm_backend_proc.cpp b/src/llvm_backend_proc.cpp
index 2c79499f4..8ce116715 100644
--- a/src/llvm_backend_proc.cpp
+++ b/src/llvm_backend_proc.cpp
@@ -578,7 +578,10 @@ gb_internal void lb_begin_procedure_body(lbProcedure *p) {
defer (param_index += 1);
if (arg_type->kind == lbArg_Ignore) {
- continue;
+ // Even though it is an ignored argument, it might still be referenced in the
+ // body.
+ lbValue dummy = lb_add_local_generated(p, e->type, false).addr;
+ lb_add_entity(p->module, e, dummy);
} else if (arg_type->kind == lbArg_Direct) {
if (e->token.string.len != 0 && !is_blank_ident(e->token.string)) {
LLVMTypeRef param_type = lb_type(p->module, e->type);
@@ -1051,6 +1054,7 @@ gb_internal lbValue lb_emit_call(lbProcedure *p, lbValue value, Array<lbValue> c
Type *original_type = e->type;
lbArgType *arg = &ft->args[param_index];
if (arg->kind == lbArg_Ignore) {
+ param_index += 1;
continue;
}