Introduce DtoAlignment() and overload DtoAlloca() for VarDeclarations

Trying to get the alignment right by using the first non-default one
in the following order of descending priority:

VarDeclaration::alignment [variables only of course]
Type::alignment()
Type::alignsize()

This fixes `align(x) struct S { ... }`.
This commit is contained in:
Martin 2015-10-16 19:05:05 +02:00
parent 8211be11de
commit 05c10d9107
11 changed files with 48 additions and 23 deletions

View file

@ -876,7 +876,7 @@ void DtoDefineFunction(FuncDeclaration* fd)
// Create the param here and set it to a "dummy" alloca that
// we do not store to here.
irparam = getIrParameter(vd, true);
irparam->value = DtoAlloca(vd->type, vd->ident->toChars());
irparam->value = DtoAlloca(vd, vd->ident->toChars());
}
else
{