Respect type alignment when choosing padding fields.

Fixes ABI mismatch when e.g. padding a 28 byte union from a
20 byte member, where previously, an i64 would be emitted,
yielding a 32 byte LLVM struct size on ulong.alignof == 8
platforms.

Test case will follow on the 2.064 branch.
This commit is contained in:
David Nadlinger
2013-12-26 06:23:39 +01:00
parent 27ecc11915
commit f85d2a5a0a
4 changed files with 70 additions and 42 deletions

View File

@@ -37,7 +37,6 @@
//////////////////////////////////////////////////////////////////////////////
extern LLConstant* get_default_initializer(VarDeclaration* vd, Initializer* init);
extern size_t add_zeros(std::vector<llvm::Constant*>& constants, size_t diff);
extern LLConstant* DtoDefineClassInfo(ClassDeclaration* cd);