diff options
| author | gingerBill <bill@gingerbill.org> | 2022-07-24 13:11:48 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2022-07-24 13:11:48 +0100 |
| commit | c8ab1b7ee1b1ba6444a057c6afa6a9d6eb7a7dae (patch) | |
| tree | d7f5ed420a4ab42f398980b1250200a0bea27056 /src/llvm_backend_general.cpp | |
| parent | 9f10487678e6adcb654eadb75b08eb731090c2ec (diff) | |
Add `#by_ptr` procedure attribute to enforce a parameter to be passed by pointer internally
Diffstat (limited to 'src/llvm_backend_general.cpp')
| -rw-r--r-- | src/llvm_backend_general.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/llvm_backend_general.cpp b/src/llvm_backend_general.cpp index b2a609f85..a4c2ce370 100644 --- a/src/llvm_backend_general.cpp +++ b/src/llvm_backend_general.cpp @@ -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 { |