From ba62bcf116e93e8bd159b6b452c62856cad526f0 Mon Sep 17 00:00:00 2001 From: Matias Fernandez Date: Tue, 9 Mar 2021 23:17:34 -0400 Subject: Add LLVM boolean compatibility to result types --- src/check_type.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/check_type.cpp') diff --git a/src/check_type.cpp b/src/check_type.cpp index 0a3a49550..2fbe4bcff 100644 --- a/src/check_type.cpp +++ b/src/check_type.cpp @@ -2388,6 +2388,18 @@ Type *type_to_abi_compat_result_type(gbAllocator a, Type *original_type, ProcCal new_type = tuple; } + if (cc == ProcCC_None) { + for_array(i, new_type->Tuple.variables) { + Type *result_type = new_type->Tuple.variables[i]->type; + if (is_type_boolean(result_type)) { + Type *t = core_type(base_type(result_type)); + if (t == t_bool) { + new_type->Tuple.variables[i]->type = t_llvm_bool; + } + } + } + } + new_type->cached_size = -1; new_type->cached_align = -1; return new_type; -- cgit v1.2.3