Mercurial > projects > ldc
annotate dmd/mtype.h @ 1194:1853dcd9b944
Moved some DMDFE files into a seperate dmd/root subdir to closer match the DMD file structure since 1.041.
author | Tomas Lindquist Olsen <tomas.l.olsen gmail.com> |
---|---|
date | Fri, 03 Apr 2009 17:02:52 +0200 |
parents | 3251ce06c820 |
children | 79758fd2f48a |
rev | line source |
---|---|
159 | 1 |
2 // Compiler implementation of the D programming language | |
3 // Copyright (c) 1999-2007 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. | |
10 | |
11 #ifndef DMD_MTYPE_H | |
12 #define DMD_MTYPE_H | |
13 | |
14 #ifdef __DMC__ | |
15 #pragma once | |
16 #endif /* __DMC__ */ | |
17 | |
18 #include "root.h" | |
19 #include "stringtable.h" | |
20 | |
21 #include "arraytypes.h" | |
22 #include "expression.h" | |
23 | |
1146
1860414bf3b7
* Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1103
diff
changeset
|
24 #if IN_LLVM |
173
db9890b3fb64
[svn r189] moving IR data back into DMD frontend nodes
ChristianK
parents:
162
diff
changeset
|
25 // llvm |
1184
a6dbd571d417
Moved ir/irtype.* into ir/irdtype.*.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1147
diff
changeset
|
26 #include "../ir/irdtype.h" |
1051
dc608dc33081
Make IrFuncTy a member of TypeFunction. Reset between modules compiled in the
Christian Kamm <kamm incasoftware de>
parents:
1029
diff
changeset
|
27 #include "../ir/irfuncty.h" |
938
a904cc9bc064
Convert struct arg to integer when passing inreg to make sure LLVM doesn't
Christian Kamm <kamm incasoftware de>
parents:
930
diff
changeset
|
28 namespace llvm { class Type; } |
1147
dbe4af57b240
Changed use of toObjFile to a new codegen method.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1146
diff
changeset
|
29 struct Ir; |
1192
3251ce06c820
Started seperating type resolution from the rest of codegen again, the merge had too many regressions.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1184
diff
changeset
|
30 |
3251ce06c820
Started seperating type resolution from the rest of codegen again, the merge had too many regressions.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1184
diff
changeset
|
31 class IrType; |
1146
1860414bf3b7
* Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1103
diff
changeset
|
32 #endif |
173
db9890b3fb64
[svn r189] moving IR data back into DMD frontend nodes
ChristianK
parents:
162
diff
changeset
|
33 |
159 | 34 struct Scope; |
35 struct Identifier; | |
36 struct Expression; | |
37 struct StructDeclaration; | |
38 struct ClassDeclaration; | |
39 struct VarDeclaration; | |
40 struct EnumDeclaration; | |
41 struct TypedefDeclaration; | |
42 struct TypeInfoDeclaration; | |
43 struct Dsymbol; | |
44 struct TemplateInstance; | |
1103
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1051
diff
changeset
|
45 struct CppMangleState; |
159 | 46 enum LINK; |
47 | |
48 struct TypeBasic; | |
49 struct HdrGenState; | |
1103
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1051
diff
changeset
|
50 struct Argument; |
159 | 51 |
52 // Back end | |
53 #if IN_GCC | |
54 union tree_node; typedef union tree_node TYPE; | |
55 typedef TYPE type; | |
1146
1860414bf3b7
* Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1103
diff
changeset
|
56 #endif |
1860414bf3b7
* Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1103
diff
changeset
|
57 |
1860414bf3b7
* Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1103
diff
changeset
|
58 #if IN_DMD |
159 | 59 typedef struct TYPE type; |
1146
1860414bf3b7
* Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1103
diff
changeset
|
60 struct Symbol; |
159 | 61 #endif |
62 | |
63 enum TY | |
64 { | |
65 Tarray, // dynamic array | |
66 Tsarray, // static array | |
67 Taarray, // associative array | |
68 Tpointer, | |
69 Treference, | |
70 Tfunction, | |
71 Tident, | |
72 Tclass, | |
73 Tstruct, | |
74 Tenum, | |
75 Ttypedef, | |
76 Tdelegate, | |
77 | |
78 Tnone, | |
79 Tvoid, | |
80 Tint8, | |
81 Tuns8, | |
82 Tint16, | |
83 Tuns16, | |
84 Tint32, | |
85 Tuns32, | |
86 Tint64, | |
87 Tuns64, | |
88 Tfloat32, | |
89 Tfloat64, | |
90 Tfloat80, | |
91 | |
92 Timaginary32, | |
93 Timaginary64, | |
94 Timaginary80, | |
95 | |
96 Tcomplex32, | |
97 Tcomplex64, | |
98 Tcomplex80, | |
99 | |
100 Tbit, | |
101 Tbool, | |
102 Tchar, | |
103 Twchar, | |
104 Tdchar, | |
105 | |
106 Terror, | |
107 Tinstance, | |
108 Ttypeof, | |
109 Ttuple, | |
110 Tslice, | |
1103
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1051
diff
changeset
|
111 Treturn, |
159 | 112 TMAX |
113 }; | |
114 | |
115 #define Tascii Tchar | |
116 | |
117 extern int Tsize_t; | |
118 extern int Tptrdiff_t; | |
119 | |
1103
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1051
diff
changeset
|
120 |
159 | 121 struct Type : Object |
122 { | |
123 TY ty; | |
1103
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1051
diff
changeset
|
124 unsigned char mod; // modifiers MODxxxx |
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1051
diff
changeset
|
125 /* pick this order of numbers so switch statements work better |
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1051
diff
changeset
|
126 */ |
159 | 127 #define MODconst 1 // type is const |
1103
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1051
diff
changeset
|
128 #define MODinvariant 4 // type is invariant |
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1051
diff
changeset
|
129 #define MODshared 2 // type is shared |
159 | 130 char *deco; |
131 Type *pto; // merged pointer to this type | |
132 Type *rto; // reference to this type | |
133 Type *arrayof; // array of this type | |
134 TypeInfoDeclaration *vtinfo; // TypeInfo object for this Type | |
135 | |
1146
1860414bf3b7
* Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1103
diff
changeset
|
136 #if IN_DMD |
159 | 137 type *ctype; // for back end |
1146
1860414bf3b7
* Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1103
diff
changeset
|
138 #endif |
159 | 139 |
140 #define tvoid basic[Tvoid] | |
141 #define tint8 basic[Tint8] | |
142 #define tuns8 basic[Tuns8] | |
143 #define tint16 basic[Tint16] | |
144 #define tuns16 basic[Tuns16] | |
145 #define tint32 basic[Tint32] | |
146 #define tuns32 basic[Tuns32] | |
147 #define tint64 basic[Tint64] | |
148 #define tuns64 basic[Tuns64] | |
149 #define tfloat32 basic[Tfloat32] | |
150 #define tfloat64 basic[Tfloat64] | |
151 #define tfloat80 basic[Tfloat80] | |
152 | |
153 #define timaginary32 basic[Timaginary32] | |
154 #define timaginary64 basic[Timaginary64] | |
155 #define timaginary80 basic[Timaginary80] | |
156 | |
157 #define tcomplex32 basic[Tcomplex32] | |
158 #define tcomplex64 basic[Tcomplex64] | |
159 #define tcomplex80 basic[Tcomplex80] | |
160 | |
161 #define tbit basic[Tbit] | |
162 #define tbool basic[Tbool] | |
163 #define tchar basic[Tchar] | |
164 #define twchar basic[Twchar] | |
165 #define tdchar basic[Tdchar] | |
166 | |
167 // Some special types | |
168 #define tshiftcnt tint32 // right side of shift expression | |
169 // #define tboolean tint32 // result of boolean expression | |
170 #define tboolean tbool // result of boolean expression | |
171 #define tindex tint32 // array/ptr index | |
172 static Type *tvoidptr; // void* | |
173 #define terror basic[Terror] // for error recovery | |
174 | |
175 #define tsize_t basic[Tsize_t] // matches size_t alias | |
176 #define tptrdiff_t basic[Tptrdiff_t] // matches ptrdiff_t alias | |
177 #define thash_t tsize_t // matches hash_t alias | |
178 | |
179 static ClassDeclaration *typeinfo; | |
180 static ClassDeclaration *typeinfoclass; | |
181 static ClassDeclaration *typeinfointerface; | |
182 static ClassDeclaration *typeinfostruct; | |
183 static ClassDeclaration *typeinfotypedef; | |
184 static ClassDeclaration *typeinfopointer; | |
185 static ClassDeclaration *typeinfoarray; | |
186 static ClassDeclaration *typeinfostaticarray; | |
187 static ClassDeclaration *typeinfoassociativearray; | |
188 static ClassDeclaration *typeinfoenum; | |
189 static ClassDeclaration *typeinfofunction; | |
190 static ClassDeclaration *typeinfodelegate; | |
191 static ClassDeclaration *typeinfotypelist; | |
192 | |
193 static Type *basic[TMAX]; | |
194 static unsigned char mangleChar[TMAX]; | |
195 static StringTable stringtable; | |
196 | |
197 // These tables are for implicit conversion of binary ops; | |
198 // the indices are the type of operand one, followed by operand two. | |
199 static unsigned char impcnvResult[TMAX][TMAX]; | |
200 static unsigned char impcnvType1[TMAX][TMAX]; | |
201 static unsigned char impcnvType2[TMAX][TMAX]; | |
202 | |
203 // If !=0, give warning on implicit conversion | |
204 static unsigned char impcnvWarn[TMAX][TMAX]; | |
205 | |
206 Type(TY ty, Type *next); | |
207 virtual Type *syntaxCopy(); | |
208 int equals(Object *o); | |
209 int dyncast() { return DYNCAST_TYPE; } // kludge for template.isType() | |
210 int covariant(Type *t); | |
211 char *toChars(); | |
212 static char needThisPrefix(); | |
1147
dbe4af57b240
Changed use of toObjFile to a new codegen method.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1146
diff
changeset
|
213 #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
|
214 static void init(Ir*); |
dbe4af57b240
Changed use of toObjFile to a new codegen method.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1146
diff
changeset
|
215 #else |
159 | 216 static void init(); |
1147
dbe4af57b240
Changed use of toObjFile to a new codegen method.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1146
diff
changeset
|
217 #endif |
159 | 218 d_uns64 size(); |
219 virtual d_uns64 size(Loc loc); | |
220 virtual unsigned alignsize(); | |
221 virtual Type *semantic(Loc loc, Scope *sc); | |
222 virtual void toDecoBuffer(OutBuffer *buf); | |
223 Type *merge(); | |
224 virtual void toCBuffer(OutBuffer *buf, Identifier *ident, HdrGenState *hgs); | |
225 virtual void toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod); | |
226 void toCBuffer3(OutBuffer *buf, HdrGenState *hgs, int mod); | |
227 virtual int isbit(); | |
228 virtual int isintegral(); | |
229 virtual int isfloating(); // real, imaginary, or complex | |
230 virtual int isreal(); | |
231 virtual int isimaginary(); | |
232 virtual int iscomplex(); | |
233 virtual int isscalar(); | |
234 virtual int isunsigned(); | |
235 virtual int isauto(); | |
236 virtual int isString(); | |
237 virtual int checkBoolean(); // if can be converted to boolean value | |
238 void checkDeprecated(Loc loc, Scope *sc); | |
239 Type *pointerTo(); | |
240 Type *referenceTo(); | |
241 Type *arrayOf(); | |
242 virtual Dsymbol *toDsymbol(Scope *sc); | |
243 virtual Type *toBasetype(); | |
244 virtual int isBaseOf(Type *t, int *poffset); | |
245 virtual MATCH implicitConvTo(Type *to); | |
246 virtual ClassDeclaration *isClassHandle(); | |
247 virtual Expression *getProperty(Loc loc, Identifier *ident); | |
248 virtual Expression *dotExp(Scope *sc, Expression *e, Identifier *ident); | |
249 virtual unsigned memalign(unsigned salign); | |
250 virtual Expression *defaultInit(Loc loc = 0); | |
251 virtual int isZeroInit(); // if initializer is 0 | |
1146
1860414bf3b7
* Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1103
diff
changeset
|
252 #if IN_DMD |
159 | 253 virtual dt_t **toDt(dt_t **pdt); |
1146
1860414bf3b7
* Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1103
diff
changeset
|
254 #endif |
159 | 255 Identifier *getTypeInfoIdent(int internal); |
256 virtual MATCH deduceType(Scope *sc, Type *tparam, TemplateParameters *parameters, Objects *dedtypes); | |
257 virtual void resolve(Loc loc, Scope *sc, Expression **pe, Type **pt, Dsymbol **ps); | |
258 Expression *getInternalTypeInfo(Scope *sc); | |
259 Expression *getTypeInfo(Scope *sc); | |
260 virtual TypeInfoDeclaration *getTypeInfoDeclaration(); | |
261 virtual int builtinTypeInfo(); | |
262 virtual Type *reliesOnTident(); | |
263 virtual Expression *toExpression(); | |
264 virtual int hasPointers(); | |
1103
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1051
diff
changeset
|
265 Type *next; |
159 | 266 Type *nextOf() { return next; } |
267 | |
268 static void error(Loc loc, const char *format, ...); | |
1103
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1051
diff
changeset
|
269 static void warning(Loc loc, const char *format, ...); |
159 | 270 |
1146
1860414bf3b7
* Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1103
diff
changeset
|
271 #if IN_DMD |
159 | 272 // For backend |
273 virtual unsigned totym(); | |
274 virtual type *toCtype(); | |
275 virtual type *toCParamtype(); | |
276 virtual Symbol *toSymbol(); | |
1146
1860414bf3b7
* Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1103
diff
changeset
|
277 #endif |
159 | 278 |
279 // For eliminating dynamic_cast | |
280 virtual TypeBasic *isTypeBasic(); | |
173
db9890b3fb64
[svn r189] moving IR data back into DMD frontend nodes
ChristianK
parents:
162
diff
changeset
|
281 |
1146
1860414bf3b7
* Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1103
diff
changeset
|
282 #if IN_LLVM |
663
6aaa3d3c1183
First part of rename to LDC.
Christian Kamm <kamm incasoftware de>
parents:
658
diff
changeset
|
283 // LDC |
1184
a6dbd571d417
Moved ir/irtype.* into ir/irdtype.*.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1147
diff
changeset
|
284 IrDType ir; |
1147
dbe4af57b240
Changed use of toObjFile to a new codegen method.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1146
diff
changeset
|
285 static Ir* sir; |
1192
3251ce06c820
Started seperating type resolution from the rest of codegen again, the merge had too many regressions.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1184
diff
changeset
|
286 |
3251ce06c820
Started seperating type resolution from the rest of codegen again, the merge had too many regressions.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1184
diff
changeset
|
287 IrType* irtype; |
1146
1860414bf3b7
* Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1103
diff
changeset
|
288 #endif |
159 | 289 }; |
290 | |
291 struct TypeBasic : Type | |
292 { | |
658
50383e476c7e
Upgraded frontend to DMD 1.035
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
508
diff
changeset
|
293 const char *dstring; |
50383e476c7e
Upgraded frontend to DMD 1.035
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
508
diff
changeset
|
294 const char *cstring; |
159 | 295 unsigned flags; |
296 | |
297 TypeBasic(TY ty); | |
298 Type *syntaxCopy(); | |
299 d_uns64 size(Loc loc); | |
300 unsigned alignsize(); | |
301 Expression *getProperty(Loc loc, Identifier *ident); | |
302 Expression *dotExp(Scope *sc, Expression *e, Identifier *ident); | |
303 char *toChars(); | |
304 void toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod); | |
305 int isintegral(); | |
306 int isbit(); | |
307 int isfloating(); | |
308 int isreal(); | |
309 int isimaginary(); | |
310 int iscomplex(); | |
311 int isscalar(); | |
312 int isunsigned(); | |
313 MATCH implicitConvTo(Type *to); | |
314 Expression *defaultInit(Loc loc); | |
315 int isZeroInit(); | |
316 int builtinTypeInfo(); | |
317 | |
318 // For eliminating dynamic_cast | |
319 TypeBasic *isTypeBasic(); | |
320 }; | |
321 | |
322 struct TypeArray : Type | |
323 { | |
324 TypeArray(TY ty, Type *next); | |
325 Expression *dotExp(Scope *sc, Expression *e, Identifier *ident); | |
326 }; | |
327 | |
328 // Static array, one with a fixed dimension | |
329 struct TypeSArray : TypeArray | |
330 { | |
331 Expression *dim; | |
332 | |
333 TypeSArray(Type *t, Expression *dim); | |
334 Type *syntaxCopy(); | |
335 d_uns64 size(Loc loc); | |
336 unsigned alignsize(); | |
337 Type *semantic(Loc loc, Scope *sc); | |
338 void resolve(Loc loc, Scope *sc, Expression **pe, Type **pt, Dsymbol **ps); | |
339 void toDecoBuffer(OutBuffer *buf); | |
340 void toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod); | |
341 Expression *dotExp(Scope *sc, Expression *e, Identifier *ident); | |
342 int isString(); | |
343 int isZeroInit(); | |
344 unsigned memalign(unsigned salign); | |
345 MATCH implicitConvTo(Type *to); | |
346 Expression *defaultInit(Loc loc); | |
1146
1860414bf3b7
* Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1103
diff
changeset
|
347 #if IN_DMD |
159 | 348 dt_t **toDt(dt_t **pdt); |
349 dt_t **toDtElem(dt_t **pdt, Expression *e); | |
1146
1860414bf3b7
* Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1103
diff
changeset
|
350 #endif |
159 | 351 MATCH deduceType(Scope *sc, Type *tparam, TemplateParameters *parameters, Objects *dedtypes); |
352 TypeInfoDeclaration *getTypeInfoDeclaration(); | |
353 Expression *toExpression(); | |
354 int hasPointers(); | |
355 | |
1146
1860414bf3b7
* Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1103
diff
changeset
|
356 #if IN_DMD |
159 | 357 type *toCtype(); |
358 type *toCParamtype(); | |
1146
1860414bf3b7
* Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1103
diff
changeset
|
359 #endif |
159 | 360 }; |
361 | |
362 // Dynamic array, no dimension | |
363 struct TypeDArray : TypeArray | |
364 { | |
365 TypeDArray(Type *t); | |
366 Type *syntaxCopy(); | |
367 d_uns64 size(Loc loc); | |
368 unsigned alignsize(); | |
369 Type *semantic(Loc loc, Scope *sc); | |
370 void toDecoBuffer(OutBuffer *buf); | |
371 void toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod); | |
372 Expression *dotExp(Scope *sc, Expression *e, Identifier *ident); | |
373 int isString(); | |
374 int isZeroInit(); | |
375 int checkBoolean(); | |
376 MATCH implicitConvTo(Type *to); | |
377 Expression *defaultInit(Loc loc); | |
378 int builtinTypeInfo(); | |
379 TypeInfoDeclaration *getTypeInfoDeclaration(); | |
380 int hasPointers(); | |
381 | |
1146
1860414bf3b7
* Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1103
diff
changeset
|
382 #if IN_DMD |
159 | 383 type *toCtype(); |
1146
1860414bf3b7
* Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1103
diff
changeset
|
384 #endif |
159 | 385 }; |
386 | |
387 struct TypeAArray : TypeArray | |
388 { | |
389 Type *index; // key type for type checking | |
390 Type *key; // actual key type | |
391 | |
392 TypeAArray(Type *t, Type *index); | |
393 Type *syntaxCopy(); | |
394 d_uns64 size(Loc loc); | |
395 Type *semantic(Loc loc, Scope *sc); | |
336 | 396 void resolve(Loc loc, Scope *sc, Expression **pe, Type **pt, Dsymbol **ps); |
159 | 397 void toDecoBuffer(OutBuffer *buf); |
398 void toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod); | |
399 Expression *dotExp(Scope *sc, Expression *e, Identifier *ident); | |
400 Expression *defaultInit(Loc loc); | |
401 MATCH deduceType(Scope *sc, Type *tparam, TemplateParameters *parameters, Objects *dedtypes); | |
211
f66219e0d530
[svn r227] Fixed: crash in lifetime.d when resizing array of AAs by .length assignment.
lindquist
parents:
173
diff
changeset
|
402 int isZeroInit(); |
159 | 403 int checkBoolean(); |
404 TypeInfoDeclaration *getTypeInfoDeclaration(); | |
405 int hasPointers(); | |
406 | |
1146
1860414bf3b7
* Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1103
diff
changeset
|
407 #if IN_DMD |
159 | 408 // Back end |
758
f04dde6e882c
Added initial D2 support, D2 frontend and changes to codegen to make things compile.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
723
diff
changeset
|
409 Symbol *aaGetSymbol(const char *func, int flags); |
159 | 410 |
411 type *toCtype(); | |
1146
1860414bf3b7
* Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1103
diff
changeset
|
412 #endif |
159 | 413 }; |
414 | |
415 struct TypePointer : Type | |
416 { | |
417 TypePointer(Type *t); | |
418 Type *syntaxCopy(); | |
419 Type *semantic(Loc loc, Scope *sc); | |
420 d_uns64 size(Loc loc); | |
421 void toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod); | |
422 MATCH implicitConvTo(Type *to); | |
423 int isscalar(); | |
663
6aaa3d3c1183
First part of rename to LDC.
Christian Kamm <kamm incasoftware de>
parents:
658
diff
changeset
|
424 // LDC: pointers are unsigned |
411
3545f9eddbfc
Switch TypePointer::isunsigned from false to true, so CmpExp::toElem chooses the right operand for pointer comparisons.
Christian Kamm <kamm incasoftware de>
parents:
379
diff
changeset
|
425 int isunsigned() { return TRUE; }; |
159 | 426 Expression *defaultInit(Loc loc); |
427 int isZeroInit(); | |
428 TypeInfoDeclaration *getTypeInfoDeclaration(); | |
429 int hasPointers(); | |
430 | |
1146
1860414bf3b7
* Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1103
diff
changeset
|
431 #if IN_DMD |
159 | 432 type *toCtype(); |
1146
1860414bf3b7
* Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1103
diff
changeset
|
433 #endif |
159 | 434 }; |
435 | |
436 struct TypeReference : Type | |
437 { | |
438 TypeReference(Type *t); | |
439 Type *syntaxCopy(); | |
440 d_uns64 size(Loc loc); | |
441 void toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod); | |
442 Expression *dotExp(Scope *sc, Expression *e, Identifier *ident); | |
443 Expression *defaultInit(Loc loc); | |
444 int isZeroInit(); | |
445 }; | |
446 | |
447 enum RET | |
448 { | |
449 RETregs = 1, // returned in registers | |
450 RETstack = 2, // returned on stack | |
451 }; | |
452 | |
453 struct TypeFunction : Type | |
454 { | |
455 Arguments *parameters; // function parameters | |
456 int varargs; // 1: T t, ...) style for variable number of arguments | |
457 // 2: T t ...) style for variable number of arguments | |
458 enum LINK linkage; // calling convention | |
459 | |
460 int inuse; | |
461 | |
462 TypeFunction(Arguments *parameters, Type *treturn, int varargs, enum LINK linkage); | |
463 Type *syntaxCopy(); | |
464 Type *semantic(Loc loc, Scope *sc); | |
465 void toDecoBuffer(OutBuffer *buf); | |
466 void toCBuffer(OutBuffer *buf, Identifier *ident, HdrGenState *hgs); | |
467 void toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod); | |
468 MATCH deduceType(Scope *sc, Type *tparam, TemplateParameters *parameters, Objects *dedtypes); | |
469 TypeInfoDeclaration *getTypeInfoDeclaration(); | |
470 Type *reliesOnTident(); | |
471 | |
472 int callMatch(Expressions *toargs); | |
1146
1860414bf3b7
* Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1103
diff
changeset
|
473 #if IN_DMD |
159 | 474 type *toCtype(); |
1146
1860414bf3b7
* Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1103
diff
changeset
|
475 #endif |
1860414bf3b7
* Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1103
diff
changeset
|
476 |
159 | 477 enum RET retStyle(); |
478 | |
1146
1860414bf3b7
* Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1103
diff
changeset
|
479 #if IN_DMD |
159 | 480 unsigned totym(); |
1146
1860414bf3b7
* Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1103
diff
changeset
|
481 #elif IN_LLVM |
663
6aaa3d3c1183
First part of rename to LDC.
Christian Kamm <kamm incasoftware de>
parents:
658
diff
changeset
|
482 // LDC |
1051
dc608dc33081
Make IrFuncTy a member of TypeFunction. Reset between modules compiled in the
Christian Kamm <kamm incasoftware de>
parents:
1029
diff
changeset
|
483 IrFuncTy fty; |
1146
1860414bf3b7
* Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1103
diff
changeset
|
484 #endif |
159 | 485 }; |
486 | |
487 struct TypeDelegate : Type | |
488 { | |
489 TypeDelegate(Type *t); | |
490 Type *syntaxCopy(); | |
491 Type *semantic(Loc loc, Scope *sc); | |
492 d_uns64 size(Loc loc); | |
797
340acf1535d0
Removed KDevelop3 project files, CMake can generate them just fine!
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
758
diff
changeset
|
493 unsigned alignsize(); // added in LDC |
159 | 494 void toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod); |
495 Expression *defaultInit(Loc loc); | |
496 int isZeroInit(); | |
497 int checkBoolean(); | |
498 TypeInfoDeclaration *getTypeInfoDeclaration(); | |
499 Expression *dotExp(Scope *sc, Expression *e, Identifier *ident); | |
500 int hasPointers(); | |
501 | |
1146
1860414bf3b7
* Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1103
diff
changeset
|
502 #if IN_DMD |
159 | 503 type *toCtype(); |
1146
1860414bf3b7
* Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1103
diff
changeset
|
504 #endif |
159 | 505 }; |
506 | |
507 struct TypeQualified : Type | |
508 { | |
509 Loc loc; | |
510 Array idents; // array of Identifier's representing ident.ident.ident etc. | |
511 | |
512 TypeQualified(TY ty, Loc loc); | |
513 void syntaxCopyHelper(TypeQualified *t); | |
514 void addIdent(Identifier *ident); | |
515 void toCBuffer2Helper(OutBuffer *buf, HdrGenState *hgs); | |
516 d_uns64 size(Loc loc); | |
517 void resolveHelper(Loc loc, Scope *sc, Dsymbol *s, Dsymbol *scopesym, | |
518 Expression **pe, Type **pt, Dsymbol **ps); | |
519 }; | |
520 | |
521 struct TypeIdentifier : TypeQualified | |
522 { | |
523 Identifier *ident; | |
524 | |
525 TypeIdentifier(Loc loc, Identifier *ident); | |
526 Type *syntaxCopy(); | |
527 //char *toChars(); | |
528 void toDecoBuffer(OutBuffer *buf); | |
529 void toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod); | |
530 void resolve(Loc loc, Scope *sc, Expression **pe, Type **pt, Dsymbol **ps); | |
531 Dsymbol *toDsymbol(Scope *sc); | |
532 Type *semantic(Loc loc, Scope *sc); | |
533 MATCH deduceType(Scope *sc, Type *tparam, TemplateParameters *parameters, Objects *dedtypes); | |
534 Type *reliesOnTident(); | |
535 Expression *toExpression(); | |
536 }; | |
537 | |
538 /* Similar to TypeIdentifier, but with a TemplateInstance as the root | |
539 */ | |
540 struct TypeInstance : TypeQualified | |
541 { | |
542 TemplateInstance *tempinst; | |
543 | |
544 TypeInstance(Loc loc, TemplateInstance *tempinst); | |
545 Type *syntaxCopy(); | |
546 //char *toChars(); | |
547 //void toDecoBuffer(OutBuffer *buf); | |
548 void toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod); | |
549 void resolve(Loc loc, Scope *sc, Expression **pe, Type **pt, Dsymbol **ps); | |
550 Type *semantic(Loc loc, Scope *sc); | |
875
330f999ade44
Merged DMD 1.038
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
797
diff
changeset
|
551 Dsymbol *toDsymbol(Scope *sc); |
159 | 552 MATCH deduceType(Scope *sc, Type *tparam, TemplateParameters *parameters, Objects *dedtypes); |
553 }; | |
554 | |
555 struct TypeTypeof : TypeQualified | |
556 { | |
557 Expression *exp; | |
558 | |
559 TypeTypeof(Loc loc, Expression *exp); | |
560 Type *syntaxCopy(); | |
561 Dsymbol *toDsymbol(Scope *sc); | |
562 void toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod); | |
563 Type *semantic(Loc loc, Scope *sc); | |
564 d_uns64 size(Loc loc); | |
565 }; | |
566 | |
567 struct TypeStruct : Type | |
568 { | |
569 StructDeclaration *sym; | |
570 | |
571 TypeStruct(StructDeclaration *sym); | |
572 d_uns64 size(Loc loc); | |
573 unsigned alignsize(); | |
574 char *toChars(); | |
575 Type *syntaxCopy(); | |
576 Type *semantic(Loc loc, Scope *sc); | |
577 Dsymbol *toDsymbol(Scope *sc); | |
578 void toDecoBuffer(OutBuffer *buf); | |
579 void toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod); | |
580 Expression *dotExp(Scope *sc, Expression *e, Identifier *ident); | |
581 unsigned memalign(unsigned salign); | |
582 Expression *defaultInit(Loc loc); | |
583 int isZeroInit(); | |
584 int checkBoolean(); | |
1146
1860414bf3b7
* Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1103
diff
changeset
|
585 #if IN_DMD |
159 | 586 dt_t **toDt(dt_t **pdt); |
1146
1860414bf3b7
* Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1103
diff
changeset
|
587 #endif |
159 | 588 MATCH deduceType(Scope *sc, Type *tparam, TemplateParameters *parameters, Objects *dedtypes); |
589 TypeInfoDeclaration *getTypeInfoDeclaration(); | |
590 int hasPointers(); | |
591 | |
1146
1860414bf3b7
* Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1103
diff
changeset
|
592 #if IN_DMD |
159 | 593 type *toCtype(); |
1146
1860414bf3b7
* Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1103
diff
changeset
|
594 #elif IN_LLVM |
1029
4d366a75d95f
Added hasUnalignedFields helper to check if a type has unaligned fields - as per request from fvbommel. Result is cached in TypeStruct.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
1024
diff
changeset
|
595 // LDC |
4d366a75d95f
Added hasUnalignedFields helper to check if a type has unaligned fields - as per request from fvbommel. Result is cached in TypeStruct.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
1024
diff
changeset
|
596 // cache the hasUnalignedFields check |
4d366a75d95f
Added hasUnalignedFields helper to check if a type has unaligned fields - as per request from fvbommel. Result is cached in TypeStruct.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
1024
diff
changeset
|
597 // 0 = not checked, 1 = aligned, 2 = unaligned |
4d366a75d95f
Added hasUnalignedFields helper to check if a type has unaligned fields - as per request from fvbommel. Result is cached in TypeStruct.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
1024
diff
changeset
|
598 int unaligned; |
1146
1860414bf3b7
* Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1103
diff
changeset
|
599 #endif |
159 | 600 }; |
601 | |
602 struct TypeEnum : Type | |
603 { | |
604 EnumDeclaration *sym; | |
605 | |
606 TypeEnum(EnumDeclaration *sym); | |
607 d_uns64 size(Loc loc); | |
608 unsigned alignsize(); | |
609 char *toChars(); | |
486
a34078905d01
Added pragma(llvmdc, "string") for misc per-module compiler configuration, currently "string" can only be "verbose" which forces -vv for module it appears in.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
445
diff
changeset
|
610 Type *syntaxCopy(); |
159 | 611 Type *semantic(Loc loc, Scope *sc); |
612 Dsymbol *toDsymbol(Scope *sc); | |
613 void toDecoBuffer(OutBuffer *buf); | |
614 void toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod); | |
615 Expression *dotExp(Scope *sc, Expression *e, Identifier *ident); | |
616 Expression *getProperty(Loc loc, Identifier *ident); | |
617 int isintegral(); | |
618 int isfloating(); | |
619 int isscalar(); | |
620 int isunsigned(); | |
621 MATCH implicitConvTo(Type *to); | |
622 Type *toBasetype(); | |
623 Expression *defaultInit(Loc loc); | |
624 int isZeroInit(); | |
625 MATCH deduceType(Scope *sc, Type *tparam, TemplateParameters *parameters, Objects *dedtypes); | |
626 TypeInfoDeclaration *getTypeInfoDeclaration(); | |
627 int hasPointers(); | |
628 | |
1146
1860414bf3b7
* Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1103
diff
changeset
|
629 #if IN_DMD |
159 | 630 type *toCtype(); |
1146
1860414bf3b7
* Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1103
diff
changeset
|
631 #endif |
159 | 632 }; |
633 | |
634 struct TypeTypedef : Type | |
635 { | |
636 TypedefDeclaration *sym; | |
637 | |
638 TypeTypedef(TypedefDeclaration *sym); | |
639 Type *syntaxCopy(); | |
640 d_uns64 size(Loc loc); | |
641 unsigned alignsize(); | |
642 char *toChars(); | |
643 Type *semantic(Loc loc, Scope *sc); | |
644 Dsymbol *toDsymbol(Scope *sc); | |
645 void toDecoBuffer(OutBuffer *buf); | |
646 void toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod); | |
647 Expression *dotExp(Scope *sc, Expression *e, Identifier *ident); | |
648 Expression *getProperty(Loc loc, Identifier *ident); | |
649 int isbit(); | |
650 int isintegral(); | |
651 int isfloating(); | |
652 int isreal(); | |
653 int isimaginary(); | |
654 int iscomplex(); | |
655 int isscalar(); | |
656 int isunsigned(); | |
657 int checkBoolean(); | |
658 Type *toBasetype(); | |
659 MATCH implicitConvTo(Type *to); | |
660 Expression *defaultInit(Loc loc); | |
661 int isZeroInit(); | |
1146
1860414bf3b7
* Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1103
diff
changeset
|
662 #if IN_DMD |
159 | 663 dt_t **toDt(dt_t **pdt); |
1146
1860414bf3b7
* Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1103
diff
changeset
|
664 #endif |
159 | 665 MATCH deduceType(Scope *sc, Type *tparam, TemplateParameters *parameters, Objects *dedtypes); |
666 TypeInfoDeclaration *getTypeInfoDeclaration(); | |
667 int hasPointers(); | |
668 | |
1146
1860414bf3b7
* Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1103
diff
changeset
|
669 #if IN_DMD |
159 | 670 type *toCtype(); |
671 type *toCParamtype(); | |
1146
1860414bf3b7
* Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1103
diff
changeset
|
672 #endif |
159 | 673 }; |
674 | |
675 struct TypeClass : Type | |
676 { | |
677 ClassDeclaration *sym; | |
678 | |
679 TypeClass(ClassDeclaration *sym); | |
680 d_uns64 size(Loc loc); | |
681 char *toChars(); | |
682 Type *syntaxCopy(); | |
683 Type *semantic(Loc loc, Scope *sc); | |
684 Dsymbol *toDsymbol(Scope *sc); | |
685 void toDecoBuffer(OutBuffer *buf); | |
686 void toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod); | |
687 Expression *dotExp(Scope *sc, Expression *e, Identifier *ident); | |
688 ClassDeclaration *isClassHandle(); | |
689 int isBaseOf(Type *t, int *poffset); | |
690 MATCH implicitConvTo(Type *to); | |
691 Expression *defaultInit(Loc loc); | |
692 int isZeroInit(); | |
693 MATCH deduceType(Scope *sc, Type *tparam, TemplateParameters *parameters, Objects *dedtypes); | |
694 int isauto(); | |
695 int checkBoolean(); | |
696 TypeInfoDeclaration *getTypeInfoDeclaration(); | |
697 int hasPointers(); | |
698 | |
1146
1860414bf3b7
* Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1103
diff
changeset
|
699 #if IN_DMD |
159 | 700 type *toCtype(); |
701 | |
702 Symbol *toSymbol(); | |
1146
1860414bf3b7
* Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1103
diff
changeset
|
703 #endif |
159 | 704 }; |
705 | |
706 struct TypeTuple : Type | |
707 { | |
708 Arguments *arguments; // types making up the tuple | |
709 | |
710 TypeTuple(Arguments *arguments); | |
711 TypeTuple(Expressions *exps); | |
712 Type *syntaxCopy(); | |
713 Type *semantic(Loc loc, Scope *sc); | |
714 int equals(Object *o); | |
715 Type *reliesOnTident(); | |
716 void toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod); | |
717 void toDecoBuffer(OutBuffer *buf); | |
718 Expression *getProperty(Loc loc, Identifier *ident); | |
719 TypeInfoDeclaration *getTypeInfoDeclaration(); | |
720 }; | |
721 | |
722 struct TypeSlice : Type | |
723 { | |
724 Expression *lwr; | |
725 Expression *upr; | |
726 | |
727 TypeSlice(Type *next, Expression *lwr, Expression *upr); | |
728 Type *syntaxCopy(); | |
729 Type *semantic(Loc loc, Scope *sc); | |
730 void resolve(Loc loc, Scope *sc, Expression **pe, Type **pt, Dsymbol **ps); | |
731 void toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod); | |
732 }; | |
733 | |
734 /**************************************************************/ | |
735 | |
736 //enum InOut { None, In, Out, InOut, Lazy }; | |
737 | |
738 struct Argument : Object | |
739 { | |
740 //enum InOut inout; | |
741 unsigned storageClass; | |
742 Type *type; | |
743 Identifier *ident; | |
744 Expression *defaultArg; | |
745 | |
746 Argument(unsigned storageClass, Type *type, Identifier *ident, Expression *defaultArg); | |
747 Argument *syntaxCopy(); | |
748 Type *isLazyArray(); | |
749 void toDecoBuffer(OutBuffer *buf); | |
750 static Arguments *arraySyntaxCopy(Arguments *args); | |
751 static char *argsTypesToChars(Arguments *args, int varargs); | |
752 static void argsToCBuffer(OutBuffer *buf, HdrGenState *hgs, Arguments *arguments, int varargs); | |
753 static void argsToDecoBuffer(OutBuffer *buf, Arguments *arguments); | |
754 static size_t dim(Arguments *arguments); | |
755 static Argument *getNth(Arguments *arguments, size_t nth, size_t *pn = NULL); | |
756 }; | |
757 | |
758 extern int PTRSIZE; | |
759 extern int REALSIZE; | |
760 extern int REALPAD; | |
761 extern int Tsize_t; | |
762 extern int Tptrdiff_t; | |
763 | |
764 #endif /* DMD_MTYPE_H */ |