aboutsummaryrefslogtreecommitdiff
path: root/src/check_type.cpp
diff options
context:
space:
mode:
authorgingerBill <gingerBill@users.noreply.github.com>2021-03-10 09:48:57 +0000
committerGitHub <noreply@github.com>2021-03-10 09:48:57 +0000
commitd23c10d80ebde39545f393ab55908241b1b16f2d (patch)
tree903d57ea7c797af2200543b0b1b06908c96ae829 /src/check_type.cpp
parent84bb3499005e89184a46dc34dc575fd879cb6f26 (diff)
parentba62bcf116e93e8bd159b6b452c62856cad526f0 (diff)
Merge pull request #865 from matias-eduardo/patch_llvm_bool_return_types
Add LLVM boolean compatibility to result types
Diffstat (limited to 'src/check_type.cpp')
-rw-r--r--src/check_type.cpp12
1 files changed, 12 insertions, 0 deletions
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;