Add #by_ptr procedure attribute to enforce a parameter to be passed by pointer internally

This commit is contained in:
gingerBill
2022-07-24 13:11:48 +01:00
parent 9f10487678
commit c8ab1b7ee1
5 changed files with 27 additions and 4 deletions
+3 -2
View File
@@ -1958,11 +1958,12 @@ LLVMTypeRef lb_type_internal(lbModule *m, Type *type) {
if (e->flags & EntityFlag_CVarArg) {
continue;
}
Type *e_type = reduce_tuple_to_single_type(e->type);
LLVMTypeRef param_type = nullptr;
if (is_type_boolean(e_type) &&
if (e->flags & EntityFlag_ByPtr) {
param_type = lb_type(m, alloc_type_pointer(e_type));
} else if (is_type_boolean(e_type) &&
type_size_of(e_type) <= 1) {
param_type = LLVMInt1TypeInContext(m->ctx);
} else {