Mercurial > projects > ldc
annotate gen/structs.h @ 1405:a865b81fc961
Oops, didn't mean to change debug info linkage.
author | Frits van Bommel <fvbommel wxs.nl> |
---|---|
date | Thu, 21 May 2009 15:26:46 +0200 |
parents | 45aca7e7cc88 |
children |
rev | line source |
---|---|
88
058d3925950e
[svn r92] Fixed support for statically initialized unions. lots of bugfixes as cleanups too.
lindquist
parents:
diff
changeset
|
1 #ifndef LLVMD_GEN_STRUCTS_H |
058d3925950e
[svn r92] Fixed support for statically initialized unions. lots of bugfixes as cleanups too.
lindquist
parents:
diff
changeset
|
2 #define LLVMD_GEN_STRUCTS_H |
058d3925950e
[svn r92] Fixed support for statically initialized unions. lots of bugfixes as cleanups too.
lindquist
parents:
diff
changeset
|
3 |
058d3925950e
[svn r92] Fixed support for statically initialized unions. lots of bugfixes as cleanups too.
lindquist
parents:
diff
changeset
|
4 struct StructInitializer; |
100 | 5 |
1151
3cf0066e6faf
- Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
870
diff
changeset
|
6 /// Generate code for the struct. |
102
027b8d8b71ec
[svn r106] Turns out the last commit wasn't enough, now the D->LLVM process is even more split up.
lindquist
parents:
100
diff
changeset
|
7 void DtoResolveStruct(StructDeclaration* sd); |
027b8d8b71ec
[svn r106] Turns out the last commit wasn't enough, now the D->LLVM process is even more split up.
lindquist
parents:
100
diff
changeset
|
8 |
1151
3cf0066e6faf
- Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
870
diff
changeset
|
9 /// Build constant struct initializer. |
3cf0066e6faf
- Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
870
diff
changeset
|
10 LLConstant* DtoConstStructInitializer(StructInitializer* si); |
100 | 11 |
1151
3cf0066e6faf
- Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
870
diff
changeset
|
12 /// Build values for a struct literal. |
3cf0066e6faf
- Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
870
diff
changeset
|
13 std::vector<llvm::Value*> DtoStructLiteralValues(const StructDeclaration* sd, const std::vector<llvm::Value*>& inits); |
100 | 14 |
1151
3cf0066e6faf
- Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
870
diff
changeset
|
15 /// Returns a boolean=true if the two structs are equal. |
344
e20ce6d8d374
[svn r365] Implemented raw struct equality comparison, uses C memcmp.
lindquist
parents:
244
diff
changeset
|
16 LLValue* DtoStructEquals(TOK op, DValue* lhs, DValue* rhs); |
e20ce6d8d374
[svn r365] Implemented raw struct equality comparison, uses C memcmp.
lindquist
parents:
244
diff
changeset
|
17 |
1151
3cf0066e6faf
- Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
870
diff
changeset
|
18 /// index a struct one level |
705
5a2983f97498
Fixed weird struct problem from downs, see mini/compile_structs1.d
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
435
diff
changeset
|
19 LLValue* DtoIndexStruct(LLValue* src, StructDeclaration* sd, VarDeclaration* vd); |
88
058d3925950e
[svn r92] Fixed support for statically initialized unions. lots of bugfixes as cleanups too.
lindquist
parents:
diff
changeset
|
20 |
1353
45aca7e7cc88
Remove struct padding when passing or returning in registers on x86-64 (extern(D) only)
Frits van Bommel <fvbommel wxs.nl>
parents:
1151
diff
changeset
|
21 /// Return the type returned by DtoUnpaddedStruct called on a value of the |
45aca7e7cc88
Remove struct padding when passing or returning in registers on x86-64 (extern(D) only)
Frits van Bommel <fvbommel wxs.nl>
parents:
1151
diff
changeset
|
22 /// specified type. |
45aca7e7cc88
Remove struct padding when passing or returning in registers on x86-64 (extern(D) only)
Frits van Bommel <fvbommel wxs.nl>
parents:
1151
diff
changeset
|
23 /// Union types will get expanded into a struct, with a type for each member. |
45aca7e7cc88
Remove struct padding when passing or returning in registers on x86-64 (extern(D) only)
Frits van Bommel <fvbommel wxs.nl>
parents:
1151
diff
changeset
|
24 LLType* DtoUnpaddedStructType(Type* dty); |
45aca7e7cc88
Remove struct padding when passing or returning in registers on x86-64 (extern(D) only)
Frits van Bommel <fvbommel wxs.nl>
parents:
1151
diff
changeset
|
25 |
45aca7e7cc88
Remove struct padding when passing or returning in registers on x86-64 (extern(D) only)
Frits van Bommel <fvbommel wxs.nl>
parents:
1151
diff
changeset
|
26 /// Return the struct value represented by v without the padding fields. |
45aca7e7cc88
Remove struct padding when passing or returning in registers on x86-64 (extern(D) only)
Frits van Bommel <fvbommel wxs.nl>
parents:
1151
diff
changeset
|
27 /// Unions will be expanded, with a value for each member. |
45aca7e7cc88
Remove struct padding when passing or returning in registers on x86-64 (extern(D) only)
Frits van Bommel <fvbommel wxs.nl>
parents:
1151
diff
changeset
|
28 /// Note: v must be a pointer to a struct, but the return value will be a |
45aca7e7cc88
Remove struct padding when passing or returning in registers on x86-64 (extern(D) only)
Frits van Bommel <fvbommel wxs.nl>
parents:
1151
diff
changeset
|
29 /// first-class struct value. |
45aca7e7cc88
Remove struct padding when passing or returning in registers on x86-64 (extern(D) only)
Frits van Bommel <fvbommel wxs.nl>
parents:
1151
diff
changeset
|
30 LLValue* DtoUnpaddedStruct(Type* dty, LLValue* v); |
45aca7e7cc88
Remove struct padding when passing or returning in registers on x86-64 (extern(D) only)
Frits van Bommel <fvbommel wxs.nl>
parents:
1151
diff
changeset
|
31 |
45aca7e7cc88
Remove struct padding when passing or returning in registers on x86-64 (extern(D) only)
Frits van Bommel <fvbommel wxs.nl>
parents:
1151
diff
changeset
|
32 /// Undo the transformation performed by DtoUnpaddedStruct, writing to lval. |
45aca7e7cc88
Remove struct padding when passing or returning in registers on x86-64 (extern(D) only)
Frits van Bommel <fvbommel wxs.nl>
parents:
1151
diff
changeset
|
33 void DtoPaddedStruct(Type* dty, LLValue* v, LLValue* lval); |
45aca7e7cc88
Remove struct padding when passing or returning in registers on x86-64 (extern(D) only)
Frits van Bommel <fvbommel wxs.nl>
parents:
1151
diff
changeset
|
34 |
88
058d3925950e
[svn r92] Fixed support for statically initialized unions. lots of bugfixes as cleanups too.
lindquist
parents:
diff
changeset
|
35 #endif |