| author | |
| committer | |
| log | 395b5303877601ff0752baf0ca1489c652358248 |
| tree | 47208f74fc92dfb0b9fbb58c825899d00f35c4e6 |
| parent | aca6b7018443bfc012f39be486f848d6e62c532c |
Applying the wrong ABI is slightly better than using the Zig ABI, the
whole thing is so wrong it should be burned to the ground.2 files changed, 3 insertions(+), 3 deletions(-)
src/analyze.cpp+1-1| ... | ... | @@ -9044,7 +9044,7 @@ static void resolve_llvm_types_fn_type(CodeGen *g, ZigType *fn_type) { |
| 9044 | 9044 | FnTypeId *fn_type_id = &fn_type->data.fn.fn_type_id; |
| 9045 | 9045 | bool first_arg_return = want_first_arg_sret(g, fn_type_id); |
| 9046 | 9046 | bool is_async = fn_type_id->cc == CallingConventionAsync; |
| 9047 | bool is_c_abi = fn_type_id->cc == CallingConventionC; | |
| 9047 | bool is_c_abi = !calling_convention_allows_zig_types(fn_type_id->cc); | |
| 9048 | 9048 | bool prefix_arg_error_return_trace = g->have_err_ret_tracing && fn_type_can_fail(fn_type_id); |
| 9049 | 9049 | // +1 for maybe making the first argument the return value |
| 9050 | 9050 | // +1 for maybe first argument the error return trace |
src/codegen.cpp+2-2| ... | ... | @@ -2071,7 +2071,7 @@ var_ok: |
| 2071 | 2071 | |
| 2072 | 2072 | void walk_function_params(CodeGen *g, ZigType *fn_type, FnWalk *fn_walk) { |
| 2073 | 2073 | CallingConvention cc = fn_type->data.fn.fn_type_id.cc; |
| 2074 | if (cc == CallingConventionC) { | |
| 2074 | if (!calling_convention_allows_zig_types(cc)) { | |
| 2075 | 2075 | size_t src_i = 0; |
| 2076 | 2076 | for (;;) { |
| 2077 | 2077 | if (!iter_function_params_c_abi(g, fn_type, fn_walk, src_i)) |
| ... | ... | @@ -7862,7 +7862,7 @@ static void do_code_gen(CodeGen *g) { |
| 7862 | 7862 | |
| 7863 | 7863 | FnTypeId *fn_type_id = &fn_table_entry->type_entry->data.fn.fn_type_id; |
| 7864 | 7864 | CallingConvention cc = fn_type_id->cc; |
| 7865 | bool is_c_abi = cc == CallingConventionC; | |
| 7865 | bool is_c_abi = !calling_convention_allows_zig_types(cc); | |
| 7866 | 7866 | bool want_sret = want_first_arg_sret(g, fn_type_id); |
| 7867 | 7867 | |
| 7868 | 7868 | LLVMValueRef fn = fn_llvm_value(g, fn_table_entry); |