mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-19 06:13:14 +01:00
Fix GitHub issue #168 – alignment of globals.
This commit is contained in:
@@ -171,8 +171,12 @@ void VarDeclaration::codegen(Ir* p)
|
||||
#endif
|
||||
this->ir.irGlobal->value = gvar;
|
||||
|
||||
// set the alignment
|
||||
gvar->setAlignment(this->type->alignsize());
|
||||
// Set the alignment (it is important not to use type->alignsize because
|
||||
// VarDeclarations can have an align() attribute independent of the type
|
||||
// as well). FIXME: ~0 is really STRUCTALIGN_DEFAULT, change as soon as
|
||||
// 1.075 has been merged.
|
||||
if (alignment != ~0)
|
||||
gvar->setAlignment(alignment);
|
||||
|
||||
if (Logger::enabled())
|
||||
Logger::cout() << *gvar << '\n';
|
||||
|
||||
Reference in New Issue
Block a user