Mercurial > projects > ldc
diff gen/structs.h @ 1353:45aca7e7cc88
Remove struct padding when passing or returning in registers on x86-64 (extern(D) only)
author | Frits van Bommel <fvbommel wxs.nl> |
---|---|
date | Thu, 14 May 2009 20:36:55 +0200 |
parents | 3cf0066e6faf |
children |
line wrap: on
line diff
--- a/gen/structs.h Thu May 14 17:23:55 2009 +0200 +++ b/gen/structs.h Thu May 14 20:36:55 2009 +0200 @@ -18,4 +18,18 @@ /// index a struct one level LLValue* DtoIndexStruct(LLValue* src, StructDeclaration* sd, VarDeclaration* vd); +/// Return the type returned by DtoUnpaddedStruct called on a value of the +/// specified type. +/// Union types will get expanded into a struct, with a type for each member. +LLType* DtoUnpaddedStructType(Type* dty); + +/// Return the struct value represented by v without the padding fields. +/// Unions will be expanded, with a value for each member. +/// Note: v must be a pointer to a struct, but the return value will be a +/// first-class struct value. +LLValue* DtoUnpaddedStruct(Type* dty, LLValue* v); + +/// Undo the transformation performed by DtoUnpaddedStruct, writing to lval. +void DtoPaddedStruct(Type* dty, LLValue* v, LLValue* lval); + #endif