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:
Tomas Lindquist Olsen
2009-03-03 15:08:26 +01:00
parent 8cad8d6c7a
commit c3a53c0128
6 changed files with 49 additions and 0 deletions
+3
View File
@@ -4278,6 +4278,9 @@ TypeStruct::TypeStruct(StructDeclaration *sym)
: Type(Tstruct, NULL)
{
this->sym = sym;
// LDC
this->unaligned = 0;
}
char *TypeStruct::toChars()
+5
View File
@@ -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