aboutsummaryrefslogtreecommitdiff
path: root/src/codegen.cpp
diff options
context:
space:
mode:
authorLemonBoy <thatlemon@gmail.com>2020-04-22 12:52:24 +0200
committerLemonBoy <thatlemon@gmail.com>2020-04-22 12:52:24 +0200
commit395b5303877601ff0752baf0ca1489c652358248 (patch)
tree47208f74fc92dfb0b9fbb58c825899d00f35c4e6 /src/codegen.cpp
parentaca6b7018443bfc012f39be486f848d6e62c532c (diff)
downloadzig-395b5303877601ff0752baf0ca1489c652358248.tar.gz
zig-395b5303877601ff0752baf0ca1489c652358248.zip
stage1: Another hack for the C ABI compatibility
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.
Diffstat (limited to 'src/codegen.cpp')
-rw-r--r--src/codegen.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/codegen.cpp b/src/codegen.cpp
index dad8e4768a..730f2695e0 100644
--- a/src/codegen.cpp
+++ b/src/codegen.cpp
@@ -2071,7 +2071,7 @@ var_ok:
void walk_function_params(CodeGen *g, ZigType *fn_type, FnWalk *fn_walk) {
CallingConvention cc = fn_type->data.fn.fn_type_id.cc;
- if (cc == CallingConventionC) {
+ if (!calling_convention_allows_zig_types(cc)) {
size_t src_i = 0;
for (;;) {
if (!iter_function_params_c_abi(g, fn_type, fn_walk, src_i))
@@ -7862,7 +7862,7 @@ static void do_code_gen(CodeGen *g) {
FnTypeId *fn_type_id = &fn_table_entry->type_entry->data.fn.fn_type_id;
CallingConvention cc = fn_type_id->cc;
- bool is_c_abi = cc == CallingConventionC;
+ bool is_c_abi = !calling_convention_allows_zig_types(cc);
bool want_sret = want_first_arg_sret(g, fn_type_id);
LLVMValueRef fn = fn_llvm_value(g, fn_table_entry);