Adds missing alignment to sret.

This commit is contained in:
Christoffer Lerno
2021-07-14 11:53:09 +02:00
parent 89a1f62ea8
commit 0111fe936e
3 changed files with 3 additions and 2 deletions

View File

@@ -20,7 +20,7 @@ func double log10(double x)
const double LG6 = 1.531383769920937332e-01; /* 3FC39A09 D078C69F */
const double LG7 = 1.479819860511658591e-01; /* 3FC2F112 DF3E5244 */
DoubleLong u = { .f = x };
uint hx = (uint)(u.i >> 32);
ulong hx = (uint)(u.i >> 32);
int k = 0;
if (hx < 0x00100000 || hx >> 31)
{

View File

@@ -11,7 +11,6 @@ enum AllocationKind
REALLOC,
FREE,
}
enum AllocationFailureKind
{
OUT_OF_MEMORY

View File

@@ -502,6 +502,8 @@ static void llvm_emit_param_attributes(GenContext *context, LLVMValueRef functio
}
if (is_return)
{
llvm_attribute_add_int(context, function, attribute_align, type_abi_alignment(type_voidptr), 1);
// TODO then type attributes are added to LLVM-C, use that for sret.
llvm_attribute_add(context, function, attribute_sret, 1);
}
else