Mercurial > projects > ldc
annotate dmd/enum.h @ 1351:8d501abecd24
Initial (but disabled) fix for ticket #294 , the actual part that fixes the bug is in a #if 0 block as I'm afraid it will cause regressions. I'm most likely not going to be around tonight, and maybe not tomorrow as well, so I'm pushing it in case someone wants to run some serious testing/investigate the problem noted in llvmhelpers.cpp : realignOffset .
author | Tomas Lindquist Olsen <tomas.l.olsen gmail com> |
---|---|
date | Thu, 14 May 2009 17:20:17 +0200 |
parents | e961851fb8be |
children | def7a1d494fd |
rev | line source |
---|---|
1 | 1 |
2 // Compiler implementation of the D programming language | |
336 | 3 // Copyright (c) 1999-2008 by Digital Mars |
1 | 4 // All Rights Reserved |
5 // written by Walter Bright | |
6 // http://www.digitalmars.com | |
7 // License for redistribution is by either the Artistic License | |
8 // in artistic.txt, or the GNU General Public License in gnu.txt. | |
9 // See the included readme.txt for details. | |
10 | |
11 #ifndef DMD_ENUM_H | |
12 #define DMD_ENUM_H | |
13 | |
14 #ifdef __DMC__ | |
15 #pragma once | |
16 #endif /* __DMC__ */ | |
17 | |
18 #include "root.h" | |
19 #include "dsymbol.h" | |
20 | |
21 struct Identifier; | |
22 struct Type; | |
23 struct Expression; | |
24 #ifdef _DH | |
25 struct HdrGenState; | |
26 #endif | |
27 | |
28 | |
29 struct EnumDeclaration : ScopeDsymbol | |
30 { | |
31 Type *type; // the TypeEnum | |
32 Type *memtype; // type of the members | |
336 | 33 |
34 #if DMDV1 | |
1195
e961851fb8be
Merged DMD 1.042.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1147
diff
changeset
|
35 dinteger_t maxval; |
e961851fb8be
Merged DMD 1.042.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1147
diff
changeset
|
36 dinteger_t minval; |
e961851fb8be
Merged DMD 1.042.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1147
diff
changeset
|
37 dinteger_t defaultval; // default initializer |
336 | 38 #else |
39 Expression *maxval; | |
40 Expression *minval; | |
41 Expression *defaultval; // default initializer | |
42 | |
43 Scope *scope; // !=NULL means context to use | |
44 #endif | |
45 int isdeprecated; | |
1 | 46 |
47 EnumDeclaration(Loc loc, Identifier *id, Type *memtype); | |
48 Dsymbol *syntaxCopy(Dsymbol *s); | |
49 void semantic(Scope *sc); | |
50 int oneMember(Dsymbol **ps); | |
51 void toCBuffer(OutBuffer *buf, HdrGenState *hgs); | |
52 Type *getType(); | |
336 | 53 const char *kind(); |
54 #if DMDV2 | |
55 Dsymbol *search(Loc, Identifier *ident, int flags); | |
56 #endif | |
57 int isDeprecated(); // is Dsymbol deprecated? | |
1 | 58 |
59 void emitComment(Scope *sc); | |
60 void toDocBuffer(OutBuffer *buf); | |
61 | |
62 EnumDeclaration *isEnumDeclaration() { return this; } | |
63 | |
1147
dbe4af57b240
Changed use of toObjFile to a new codegen method.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1146
diff
changeset
|
64 #if IN_DMD |
336 | 65 void toObjFile(int multiobj); // compile to .obj file |
1 | 66 void toDebug(); |
67 int cvMember(unsigned char *p); | |
68 | |
69 Symbol *sinit; | |
70 Symbol *toInitializer(); | |
1146
1860414bf3b7
* Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
336
diff
changeset
|
71 #endif |
1147
dbe4af57b240
Changed use of toObjFile to a new codegen method.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1146
diff
changeset
|
72 |
dbe4af57b240
Changed use of toObjFile to a new codegen method.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1146
diff
changeset
|
73 #if IN_LLVM |
dbe4af57b240
Changed use of toObjFile to a new codegen method.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1146
diff
changeset
|
74 void codegen(Ir*); |
dbe4af57b240
Changed use of toObjFile to a new codegen method.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1146
diff
changeset
|
75 #endif |
1 | 76 }; |
77 | |
78 | |
79 struct EnumMember : Dsymbol | |
80 { | |
81 Expression *value; | |
82 | |
83 EnumMember(Loc loc, Identifier *id, Expression *value); | |
84 Dsymbol *syntaxCopy(Dsymbol *s); | |
85 void toCBuffer(OutBuffer *buf, HdrGenState *hgs); | |
336 | 86 const char *kind(); |
1 | 87 |
88 void emitComment(Scope *sc); | |
89 void toDocBuffer(OutBuffer *buf); | |
90 | |
91 EnumMember *isEnumMember() { return this; } | |
92 }; | |
93 | |
94 #endif /* DMD_ENUM_H */ |