| 1 |
#ifndef LLVMD_GEN_STRUCTS_H |
|---|
| 2 |
#define LLVMD_GEN_STRUCTS_H |
|---|
| 3 |
|
|---|
| 4 |
struct StructInitializer; |
|---|
| 5 |
|
|---|
| 6 |
/// Generate code for the struct. |
|---|
| 7 |
void DtoResolveStruct(StructDeclaration* sd); |
|---|
| 8 |
|
|---|
| 9 |
/// Build constant struct initializer. |
|---|
| 10 |
LLConstant* DtoConstStructInitializer(StructInitializer* si); |
|---|
| 11 |
|
|---|
| 12 |
/// Build values for a struct literal. |
|---|
| 13 |
std::vector<llvm::Value*> DtoStructLiteralValues(const StructDeclaration* sd, const std::vector<llvm::Value*>& inits); |
|---|
| 14 |
|
|---|
| 15 |
/// Returns a boolean=true if the two structs are equal. |
|---|
| 16 |
LLValue* DtoStructEquals(TOK op, DValue* lhs, DValue* rhs); |
|---|
| 17 |
|
|---|
| 18 |
/// index a struct one level |
|---|
| 19 |
LLValue* DtoIndexStruct(LLValue* src, StructDeclaration* sd, VarDeclaration* vd); |
|---|
| 20 |
|
|---|
| 21 |
/// Return the type returned by DtoUnpaddedStruct called on a value of the |
|---|
| 22 |
/// specified type. |
|---|
| 23 |
/// Union types will get expanded into a struct, with a type for each member. |
|---|
| 24 |
LLType* DtoUnpaddedStructType(Type* dty); |
|---|
| 25 |
|
|---|
| 26 |
/// Return the struct value represented by v without the padding fields. |
|---|
| 27 |
/// Unions will be expanded, with a value for each member. |
|---|
| 28 |
/// Note: v must be a pointer to a struct, but the return value will be a |
|---|
| 29 |
/// first-class struct value. |
|---|
| 30 |
LLValue* DtoUnpaddedStruct(Type* dty, LLValue* v); |
|---|
| 31 |
|
|---|
| 32 |
/// Undo the transformation performed by DtoUnpaddedStruct, writing to lval. |
|---|
| 33 |
void DtoPaddedStruct(Type* dty, LLValue* v, LLValue* lval); |
|---|
| 34 |
|
|---|
| 35 |
#endif |
|---|