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:
@@ -4278,6 +4278,9 @@ TypeStruct::TypeStruct(StructDeclaration *sym)
|
||||
: Type(Tstruct, NULL)
|
||||
{
|
||||
this->sym = sym;
|
||||
|
||||
// LDC
|
||||
this->unaligned = 0;
|
||||
}
|
||||
|
||||
char *TypeStruct::toChars()
|
||||
|
||||
@@ -542,6 +542,11 @@ struct TypeStruct : Type
|
||||
int hasPointers();
|
||||
|
||||
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