mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-11-03 15:47:26 +01:00
Added hasUnalignedFields helper to check if a type has unaligned fields - as per request from fvbommel. Result is cached in TypeStruct.
This commit is contained in:
@@ -4929,6 +4929,9 @@ TypeStruct::TypeStruct(StructDeclaration *sym)
|
||||
: Type(Tstruct)
|
||||
{
|
||||
this->sym = sym;
|
||||
|
||||
// LDC
|
||||
this->unaligned = 0;
|
||||
}
|
||||
|
||||
char *TypeStruct::toChars()
|
||||
|
||||
@@ -628,6 +628,11 @@ struct TypeStruct : Type
|
||||
#endif
|
||||
|
||||
type *toCtype();
|
||||
|
||||
// LDC
|
||||
// cache the hasUnalignedFields check
|
||||
// 0 = not checked, 1 = aligned, 2 = unaligned
|
||||
int unaligned;
|
||||
};
|
||||
|
||||
struct TypeEnum : Type
|
||||
|
||||
Reference in New Issue
Block a user