Fix previous compiler crash without breaking functions with auto return types
[delight/core.git] / dmd2 / enum.h
blob62187fdefd00d3dfe74bbe919b82848bae53f6d4
2 // Compiler implementation of the D programming language
3 // Copyright (c) 1999-2006 by Digital Mars
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.
11 /* NOTE: This file has been patched from the original DMD distribution to
12 work with the GDC compiler.
14 Modified by David Friedman, December 2006
17 #ifndef DMD_ENUM_H
18 #define DMD_ENUM_H
20 #ifdef __DMC__
21 #pragma once
22 #endif /* __DMC__ */
24 #include "root.h"
25 #include "dsymbol.h"
27 struct Identifier;
28 struct Type;
29 struct Expression;
30 #ifdef _DH
31 struct HdrGenState;
32 #endif
35 struct EnumDeclaration : ScopeDsymbol
36 { /* enum ident : memtype { ... }
38 Type *type; // the TypeEnum
39 Type *memtype; // type of the members
41 Expression *maxval;
42 Expression *minval;
43 Expression *defaultval; // default initializer
45 Scope *scope; // !=NULL means context to use
46 Expressions * attributes; // GCC decl/type attributes
48 EnumDeclaration(Loc loc, Identifier *id, Type *memtype);
49 Dsymbol *syntaxCopy(Dsymbol *s);
50 void semantic(Scope *sc);
51 int oneMember(Dsymbol **ps);
52 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
53 Type *getType();
54 char *kind();
55 Dsymbol *search(Loc, Identifier *ident, int flags);
57 void emitComment(Scope *sc);
58 void toDocBuffer(OutBuffer *buf);
60 EnumDeclaration *isEnumDeclaration() { return this; }
62 void toObjFile(int multiobj); // compile to .obj file
63 void toDebug();
64 int cvMember(unsigned char *p);
66 Symbol *sinit;
67 Symbol *toInitializer();
71 struct EnumMember : Dsymbol
73 Expression *value;
74 Type *type;
76 EnumMember(Loc loc, Identifier *id, Expression *value, Type *type);
77 Dsymbol *syntaxCopy(Dsymbol *s);
78 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
79 char *kind();
81 void emitComment(Scope *sc);
82 void toDocBuffer(OutBuffer *buf);
84 EnumMember *isEnumMember() { return this; }
87 #endif /* DMD_ENUM_H */