comparison dmd/init.h @ 1146:1860414bf3b7

* Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h. * Added #if IN_DMD versioning around DMD backend specific code in the D1 frontend, D2 is currently broken. * All part of a greater cleanup scheme.
author Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
date Thu, 26 Mar 2009 20:45:53 +0100
parents eeb8b95ea92e
children
comparison
equal deleted inserted replaced
1145:40caa8207b3e 1146:1860414bf3b7
42 virtual void toCBuffer(OutBuffer *buf, HdrGenState *hgs) = 0; 42 virtual void toCBuffer(OutBuffer *buf, HdrGenState *hgs) = 0;
43 char *toChars(); 43 char *toChars();
44 44
45 static Initializers *arraySyntaxCopy(Initializers *ai); 45 static Initializers *arraySyntaxCopy(Initializers *ai);
46 46
47 #if IN_DMD
47 virtual dt_t *toDt(); 48 virtual dt_t *toDt();
49 #endif
48 50
49 virtual VoidInitializer *isVoidInitializer() { return NULL; } 51 virtual VoidInitializer *isVoidInitializer() { return NULL; }
50 virtual StructInitializer *isStructInitializer() { return NULL; } 52 virtual StructInitializer *isStructInitializer() { return NULL; }
51 virtual ArrayInitializer *isArrayInitializer() { return NULL; } 53 virtual ArrayInitializer *isArrayInitializer() { return NULL; }
52 virtual ExpInitializer *isExpInitializer() { return NULL; } 54 virtual ExpInitializer *isExpInitializer() { return NULL; }
60 Initializer *syntaxCopy(); 62 Initializer *syntaxCopy();
61 Initializer *semantic(Scope *sc, Type *t); 63 Initializer *semantic(Scope *sc, Type *t);
62 Expression *toExpression(); 64 Expression *toExpression();
63 void toCBuffer(OutBuffer *buf, HdrGenState *hgs); 65 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
64 66
67 #if IN_DMD
65 dt_t *toDt(); 68 dt_t *toDt();
69 #endif
66 70
67 virtual VoidInitializer *isVoidInitializer() { return this; } 71 virtual VoidInitializer *isVoidInitializer() { return this; }
68 }; 72 };
69 73
70 struct StructInitializer : Initializer 74 struct StructInitializer : Initializer
80 void addInit(Identifier *field, Initializer *value); 84 void addInit(Identifier *field, Initializer *value);
81 Initializer *semantic(Scope *sc, Type *t); 85 Initializer *semantic(Scope *sc, Type *t);
82 Expression *toExpression(); 86 Expression *toExpression();
83 void toCBuffer(OutBuffer *buf, HdrGenState *hgs); 87 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
84 88
89 #if IN_DMD
85 dt_t *toDt(); 90 dt_t *toDt();
91 #endif
86 92
87 StructInitializer *isStructInitializer() { return this; } 93 StructInitializer *isStructInitializer() { return this; }
88 }; 94 };
89 95
90 struct ArrayInitializer : Initializer 96 struct ArrayInitializer : Initializer
102 Type *inferType(Scope *sc); 108 Type *inferType(Scope *sc);
103 Expression *toExpression(); 109 Expression *toExpression();
104 Initializer *toAssocArrayInitializer(); 110 Initializer *toAssocArrayInitializer();
105 void toCBuffer(OutBuffer *buf, HdrGenState *hgs); 111 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
106 112
113 #if IN_DMD
107 dt_t *toDt(); 114 dt_t *toDt();
108 dt_t *toDtBit(); // for bit arrays 115 dt_t *toDtBit(); // for bit arrays
116 #endif
109 117
110 ArrayInitializer *isArrayInitializer() { return this; } 118 ArrayInitializer *isArrayInitializer() { return this; }
111 }; 119 };
112 120
113 struct ExpInitializer : Initializer 121 struct ExpInitializer : Initializer
119 Initializer *semantic(Scope *sc, Type *t); 127 Initializer *semantic(Scope *sc, Type *t);
120 Type *inferType(Scope *sc); 128 Type *inferType(Scope *sc);
121 Expression *toExpression(); 129 Expression *toExpression();
122 void toCBuffer(OutBuffer *buf, HdrGenState *hgs); 130 void toCBuffer(OutBuffer *buf, HdrGenState *hgs);
123 131
132 #if IN_DMD
124 dt_t *toDt(); 133 dt_t *toDt();
134 #endif
125 135
126 virtual ExpInitializer *isExpInitializer() { return this; } 136 virtual ExpInitializer *isExpInitializer() { return this; }
127 }; 137 };
128 138
129 #endif 139 #endif