mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-04-28 22:21:31 +03:00
Allow align(1) for global variables.
This reverts a39997d326
, and fixes the invalid tests in std.conv.
This commit is contained in:
parent
a90fdfe624
commit
7e572e6f03
3 changed files with 13 additions and 7 deletions
|
@ -846,10 +846,10 @@ void DtoResolveVariable(VarDeclaration *vd) {
|
|||
linkage, nullptr, llName, vd->isThreadlocal());
|
||||
getIrGlobal(vd)->value = gvar;
|
||||
|
||||
// Set the alignment and use the target pointer size as lower bound.
|
||||
unsigned alignment =
|
||||
std::max(DtoAlignment(vd), gDataLayout->getPointerSize());
|
||||
gvar->setAlignment(alignment);
|
||||
// Set the alignment (it is important not to use type->alignsize because
|
||||
// VarDeclarations can have an align() attribute independent of the type
|
||||
// as well).
|
||||
gvar->setAlignment(DtoAlignment(vd));
|
||||
|
||||
applyVarDeclUDAs(vd, gvar);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue