mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-04 14:48:47 +00:00
Merge pull request #3372 from laytan/fix-lbarg-ignore-logic
fix lbArg_Ignore logic
This commit is contained in:
+1
-1
@@ -192,7 +192,7 @@ gb_internal void lb_add_function_type_attributes(LLVMValueRef fn, lbFunctionType
|
|||||||
// }
|
// }
|
||||||
LLVMSetFunctionCallConv(fn, cc_kind);
|
LLVMSetFunctionCallConv(fn, cc_kind);
|
||||||
if (calling_convention == ProcCC_Odin) {
|
if (calling_convention == ProcCC_Odin) {
|
||||||
unsigned context_index = offset+arg_count;
|
unsigned context_index = arg_index;
|
||||||
LLVMAddAttributeAtIndex(fn, context_index, noalias_attr);
|
LLVMAddAttributeAtIndex(fn, context_index, noalias_attr);
|
||||||
LLVMAddAttributeAtIndex(fn, context_index, nonnull_attr);
|
LLVMAddAttributeAtIndex(fn, context_index, nonnull_attr);
|
||||||
LLVMAddAttributeAtIndex(fn, context_index, nocapture_attr);
|
LLVMAddAttributeAtIndex(fn, context_index, nocapture_attr);
|
||||||
|
|||||||
@@ -578,7 +578,10 @@ gb_internal void lb_begin_procedure_body(lbProcedure *p) {
|
|||||||
defer (param_index += 1);
|
defer (param_index += 1);
|
||||||
|
|
||||||
if (arg_type->kind == lbArg_Ignore) {
|
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) {
|
} else if (arg_type->kind == lbArg_Direct) {
|
||||||
if (e->token.string.len != 0 && !is_blank_ident(e->token.string)) {
|
if (e->token.string.len != 0 && !is_blank_ident(e->token.string)) {
|
||||||
LLVMTypeRef param_type = lb_type(p->module, e->type);
|
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;
|
Type *original_type = e->type;
|
||||||
lbArgType *arg = &ft->args[param_index];
|
lbArgType *arg = &ft->args[param_index];
|
||||||
if (arg->kind == lbArg_Ignore) {
|
if (arg->kind == lbArg_Ignore) {
|
||||||
|
param_index += 1;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user