mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-16 04:43:14 +01:00
Set explicit alignment for normal global variables, ensures alignment is correct for globals with union type.
This commit is contained in:
@@ -136,6 +136,9 @@ void VarDeclaration::codegen(Ir* p)
|
||||
llvm::GlobalVariable* gvar = new llvm::GlobalVariable(_type,_isconst,_linkage,NULL,_name,gIR->module);
|
||||
this->ir.irGlobal->value = gvar;
|
||||
|
||||
// set the alignment
|
||||
gvar->setAlignment(this->type->alignsize());
|
||||
|
||||
if (Logger::enabled())
|
||||
Logger::cout() << *gvar << '\n';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user