Removes unneeded lookups / Adds sret to call site which fixes the mac bug

This commit is contained in:
Platin21
2021-12-23 01:59:31 +01:00
parent 0548db4230
commit 8dbeed8a9f
2 changed files with 10 additions and 6 deletions

View File

@@ -981,16 +981,16 @@ namespace lbAbiArm64 {
if (size <= 16) {
LLVMTypeRef cast_type = nullptr;
if (size <= 1) {
cast_type = LLVMIntTypeInContext(c, 8);
cast_type = LLVMInt8TypeInContext(c);
} else if (size <= 2) {
cast_type = LLVMIntTypeInContext(c, 16);
cast_type = LLVMInt16TypeInContext(c);
} else if (size <= 4) {
cast_type = LLVMIntTypeInContext(c, 32);
cast_type = LLVMInt32TypeInContext(c);
} else if (size <= 8) {
cast_type = LLVMIntTypeInContext(c, 64);
cast_type = LLVMInt64TypeInContext(c);
} else {
unsigned count = cast(unsigned)((size+7)/8);
cast_type = LLVMArrayType(LLVMIntTypeInContext(c, 64), count);
cast_type = LLVMArrayType(LLVMInt64TypeInContext(c), count);
}
return lb_arg_type_direct(type, cast_type, nullptr, nullptr);
} else {
@@ -999,7 +999,7 @@ namespace lbAbiArm64 {
}
}
}
Array<lbArgType> compute_arg_types(LLVMContextRef c, LLVMTypeRef *arg_types, unsigned arg_count) {
auto args = array_make<lbArgType>(heap_allocator(), arg_count);