Mercurial > projects > ldc
annotate dmd/mtype.h @ 1228:79758fd2f48a
Added Doxygen file.
Completely seperated type and symbol generation. Should fix a lot of bugs, but is not yet 100% complete.
author | Tomas Lindquist Olsen <tomas.l.olsen gmail.com> |
---|---|
date | Wed, 15 Apr 2009 20:06:25 +0200 |
parents | 3251ce06c820 |
children | 465a77c904d4 |
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); | |
1228
79758fd2f48a
Added Doxygen file.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1192
diff
changeset
|
222 // append the mangleof or a string uniquely identifying this type to buf |
79758fd2f48a
Added Doxygen file.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1192
diff
changeset
|
223 virtual void toDecoBuffer(OutBuffer *buf, bool mangle); |
159 | 224 Type *merge(); |
225 virtual void toCBuffer(OutBuffer *buf, Identifier *ident, HdrGenState *hgs); | |
226 virtual void toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod); | |
227 void toCBuffer3(OutBuffer *buf, HdrGenState *hgs, int mod); | |
228 virtual int isbit(); | |
229 virtual int isintegral(); | |
230 virtual int isfloating(); // real, imaginary, or complex | |
231 virtual int isreal(); | |
232 virtual int isimaginary(); | |
233 virtual int iscomplex(); | |
234 virtual int isscalar(); | |
235 virtual int isunsigned(); | |
236 virtual int isauto(); | |
237 virtual int isString(); | |
238 virtual int checkBoolean(); // if can be converted to boolean value | |
239 void checkDeprecated(Loc loc, Scope *sc); | |
240 Type *pointerTo(); | |
241 Type *referenceTo(); | |
242 Type *arrayOf(); | |
243 virtual Dsymbol *toDsymbol(Scope *sc); | |
244 virtual Type *toBasetype(); | |
245 virtual int isBaseOf(Type *t, int *poffset); | |
246 virtual MATCH implicitConvTo(Type *to); | |
247 virtual ClassDeclaration *isClassHandle(); | |
248 virtual Expression *getProperty(Loc loc, Identifier *ident); | |
249 virtual Expression *dotExp(Scope *sc, Expression *e, Identifier *ident); | |
250 virtual unsigned memalign(unsigned salign); | |
251 virtual Expression *defaultInit(Loc loc = 0); | |
252 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
|
253 #if IN_DMD |
159 | 254 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
|
255 #endif |
159 | 256 Identifier *getTypeInfoIdent(int internal); |
257 virtual MATCH deduceType(Scope *sc, Type *tparam, TemplateParameters *parameters, Objects *dedtypes); | |
258 virtual void resolve(Loc loc, Scope *sc, Expression **pe, Type **pt, Dsymbol **ps); | |
259 Expression *getInternalTypeInfo(Scope *sc); | |
260 Expression *getTypeInfo(Scope *sc); | |
261 virtual TypeInfoDeclaration *getTypeInfoDeclaration(); | |
262 virtual int builtinTypeInfo(); | |
263 virtual Type *reliesOnTident(); | |
264 virtual Expression *toExpression(); | |
265 virtual int hasPointers(); | |
1103
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1051
diff
changeset
|
266 Type *next; |
159 | 267 Type *nextOf() { return next; } |
268 | |
269 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
|
270 static void warning(Loc loc, const char *format, ...); |
159 | 271 |
1146
1860414bf3b7
* Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1103
diff
changeset
|
272 #if IN_DMD |
159 | 273 // For backend |
274 virtual unsigned totym(); | |
275 virtual type *toCtype(); | |
276 virtual type *toCParamtype(); | |
277 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
|
278 #endif |
159 | 279 |
280 // For eliminating dynamic_cast | |
281 virtual TypeBasic *isTypeBasic(); | |
173
db9890b3fb64
[svn r189] moving IR data back into DMD frontend nodes
ChristianK
parents:
162
diff
changeset
|
282 |
1146
1860414bf3b7
* Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1103
diff
changeset
|
283 #if IN_LLVM |
663
6aaa3d3c1183
First part of rename to LDC.
Christian Kamm <kamm incasoftware de>
parents:
658
diff
changeset
|
284 // LDC |
1184
a6dbd571d417
Moved ir/irtype.* into ir/irdtype.*.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1147
diff
changeset
|
285 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
|
286 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
|
287 |
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
|
288 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
|
289 #endif |
159 | 290 }; |
291 | |
292 struct TypeBasic : Type | |
293 { | |
658
50383e476c7e
Upgraded frontend to DMD 1.035
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
508
diff
changeset
|
294 const char *dstring; |
50383e476c7e
Upgraded frontend to DMD 1.035
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
508
diff
changeset
|
295 const char *cstring; |
159 | 296 unsigned flags; |
297 | |
298 TypeBasic(TY ty); | |
299 Type *syntaxCopy(); | |
300 d_uns64 size(Loc loc); | |
301 unsigned alignsize(); | |
302 Expression *getProperty(Loc loc, Identifier *ident); | |
303 Expression *dotExp(Scope *sc, Expression *e, Identifier *ident); | |
304 char *toChars(); | |
305 void toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod); | |
306 int isintegral(); | |
307 int isbit(); | |
308 int isfloating(); | |
309 int isreal(); | |
310 int isimaginary(); | |
311 int iscomplex(); | |
312 int isscalar(); | |
313 int isunsigned(); | |
314 MATCH implicitConvTo(Type *to); | |
315 Expression *defaultInit(Loc loc); | |
316 int isZeroInit(); | |
317 int builtinTypeInfo(); | |
318 | |
319 // For eliminating dynamic_cast | |
320 TypeBasic *isTypeBasic(); | |
321 }; | |
322 | |
323 struct TypeArray : Type | |
324 { | |
325 TypeArray(TY ty, Type *next); | |
326 Expression *dotExp(Scope *sc, Expression *e, Identifier *ident); | |
327 }; | |
328 | |
329 // Static array, one with a fixed dimension | |
330 struct TypeSArray : TypeArray | |
331 { | |
332 Expression *dim; | |
333 | |
334 TypeSArray(Type *t, Expression *dim); | |
335 Type *syntaxCopy(); | |
336 d_uns64 size(Loc loc); | |
337 unsigned alignsize(); | |
338 Type *semantic(Loc loc, Scope *sc); | |
339 void resolve(Loc loc, Scope *sc, Expression **pe, Type **pt, Dsymbol **ps); | |
1228
79758fd2f48a
Added Doxygen file.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1192
diff
changeset
|
340 void toDecoBuffer(OutBuffer *buf, bool mangle); |
159 | 341 void toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod); |
342 Expression *dotExp(Scope *sc, Expression *e, Identifier *ident); | |
343 int isString(); | |
344 int isZeroInit(); | |
345 unsigned memalign(unsigned salign); | |
346 MATCH implicitConvTo(Type *to); | |
347 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
|
348 #if IN_DMD |
159 | 349 dt_t **toDt(dt_t **pdt); |
350 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
|
351 #endif |
159 | 352 MATCH deduceType(Scope *sc, Type *tparam, TemplateParameters *parameters, Objects *dedtypes); |
353 TypeInfoDeclaration *getTypeInfoDeclaration(); | |
354 Expression *toExpression(); | |
355 int hasPointers(); | |
356 | |
1146
1860414bf3b7
* Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1103
diff
changeset
|
357 #if IN_DMD |
159 | 358 type *toCtype(); |
359 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
|
360 #endif |
159 | 361 }; |
362 | |
363 // Dynamic array, no dimension | |
364 struct TypeDArray : TypeArray | |
365 { | |
366 TypeDArray(Type *t); | |
367 Type *syntaxCopy(); | |
368 d_uns64 size(Loc loc); | |
369 unsigned alignsize(); | |
370 Type *semantic(Loc loc, Scope *sc); | |
1228
79758fd2f48a
Added Doxygen file.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1192
diff
changeset
|
371 void toDecoBuffer(OutBuffer *buf, bool mangle); |
159 | 372 void toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod); |
373 Expression *dotExp(Scope *sc, Expression *e, Identifier *ident); | |
374 int isString(); | |
375 int isZeroInit(); | |
376 int checkBoolean(); | |
377 MATCH implicitConvTo(Type *to); | |
378 Expression *defaultInit(Loc loc); | |
379 int builtinTypeInfo(); | |
380 TypeInfoDeclaration *getTypeInfoDeclaration(); | |
381 int hasPointers(); | |
382 | |
1146
1860414bf3b7
* Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1103
diff
changeset
|
383 #if IN_DMD |
159 | 384 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
|
385 #endif |
159 | 386 }; |
387 | |
388 struct TypeAArray : TypeArray | |
389 { | |
390 Type *index; // key type for type checking | |
391 Type *key; // actual key type | |
392 | |
393 TypeAArray(Type *t, Type *index); | |
394 Type *syntaxCopy(); | |
395 d_uns64 size(Loc loc); | |
396 Type *semantic(Loc loc, Scope *sc); | |
336 | 397 void resolve(Loc loc, Scope *sc, Expression **pe, Type **pt, Dsymbol **ps); |
1228
79758fd2f48a
Added Doxygen file.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1192
diff
changeset
|
398 void toDecoBuffer(OutBuffer *buf, bool mangle); |
159 | 399 void toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod); |
400 Expression *dotExp(Scope *sc, Expression *e, Identifier *ident); | |
401 Expression *defaultInit(Loc loc); | |
402 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
|
403 int isZeroInit(); |
159 | 404 int checkBoolean(); |
405 TypeInfoDeclaration *getTypeInfoDeclaration(); | |
406 int hasPointers(); | |
407 | |
1146
1860414bf3b7
* Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1103
diff
changeset
|
408 #if IN_DMD |
159 | 409 // 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
|
410 Symbol *aaGetSymbol(const char *func, int flags); |
159 | 411 |
412 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
|
413 #endif |
159 | 414 }; |
415 | |
416 struct TypePointer : Type | |
417 { | |
418 TypePointer(Type *t); | |
419 Type *syntaxCopy(); | |
420 Type *semantic(Loc loc, Scope *sc); | |
421 d_uns64 size(Loc loc); | |
422 void toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod); | |
423 MATCH implicitConvTo(Type *to); | |
424 int isscalar(); | |
663
6aaa3d3c1183
First part of rename to LDC.
Christian Kamm <kamm incasoftware de>
parents:
658
diff
changeset
|
425 // 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
|
426 int isunsigned() { return TRUE; }; |
159 | 427 Expression *defaultInit(Loc loc); |
428 int isZeroInit(); | |
429 TypeInfoDeclaration *getTypeInfoDeclaration(); | |
430 int hasPointers(); | |
431 | |
1146
1860414bf3b7
* Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1103
diff
changeset
|
432 #if IN_DMD |
159 | 433 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
|
434 #endif |
159 | 435 }; |
436 | |
437 struct TypeReference : Type | |
438 { | |
439 TypeReference(Type *t); | |
440 Type *syntaxCopy(); | |
441 d_uns64 size(Loc loc); | |
442 void toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod); | |
443 Expression *dotExp(Scope *sc, Expression *e, Identifier *ident); | |
444 Expression *defaultInit(Loc loc); | |
445 int isZeroInit(); | |
446 }; | |
447 | |
448 enum RET | |
449 { | |
450 RETregs = 1, // returned in registers | |
451 RETstack = 2, // returned on stack | |
452 }; | |
453 | |
454 struct TypeFunction : Type | |
455 { | |
456 Arguments *parameters; // function parameters | |
457 int varargs; // 1: T t, ...) style for variable number of arguments | |
458 // 2: T t ...) style for variable number of arguments | |
459 enum LINK linkage; // calling convention | |
460 | |
461 int inuse; | |
462 | |
463 TypeFunction(Arguments *parameters, Type *treturn, int varargs, enum LINK linkage); | |
464 Type *syntaxCopy(); | |
465 Type *semantic(Loc loc, Scope *sc); | |
1228
79758fd2f48a
Added Doxygen file.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1192
diff
changeset
|
466 void toDecoBuffer(OutBuffer *buf, bool mangle); |
159 | 467 void toCBuffer(OutBuffer *buf, Identifier *ident, HdrGenState *hgs); |
468 void toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod); | |
469 MATCH deduceType(Scope *sc, Type *tparam, TemplateParameters *parameters, Objects *dedtypes); | |
470 TypeInfoDeclaration *getTypeInfoDeclaration(); | |
471 Type *reliesOnTident(); | |
472 | |
473 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
|
474 #if IN_DMD |
159 | 475 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
|
476 #endif |
1860414bf3b7
* Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1103
diff
changeset
|
477 |
159 | 478 enum RET retStyle(); |
479 | |
1146
1860414bf3b7
* Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1103
diff
changeset
|
480 #if IN_DMD |
159 | 481 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
|
482 #elif IN_LLVM |
663
6aaa3d3c1183
First part of rename to LDC.
Christian Kamm <kamm incasoftware de>
parents:
658
diff
changeset
|
483 // LDC |
1051
dc608dc33081
Make IrFuncTy a member of TypeFunction. Reset between modules compiled in the
Christian Kamm <kamm incasoftware de>
parents:
1029
diff
changeset
|
484 IrFuncTy fty; |
1228
79758fd2f48a
Added Doxygen file.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1192
diff
changeset
|
485 |
79758fd2f48a
Added Doxygen file.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1192
diff
changeset
|
486 FuncDeclaration* funcdecl; |
1146
1860414bf3b7
* Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1103
diff
changeset
|
487 #endif |
159 | 488 }; |
489 | |
490 struct TypeDelegate : Type | |
491 { | |
492 TypeDelegate(Type *t); | |
493 Type *syntaxCopy(); | |
494 Type *semantic(Loc loc, Scope *sc); | |
495 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
|
496 unsigned alignsize(); // added in LDC |
159 | 497 void toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod); |
498 Expression *defaultInit(Loc loc); | |
499 int isZeroInit(); | |
500 int checkBoolean(); | |
501 TypeInfoDeclaration *getTypeInfoDeclaration(); | |
502 Expression *dotExp(Scope *sc, Expression *e, Identifier *ident); | |
503 int hasPointers(); | |
504 | |
1146
1860414bf3b7
* Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1103
diff
changeset
|
505 #if IN_DMD |
159 | 506 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
|
507 #endif |
159 | 508 }; |
509 | |
510 struct TypeQualified : Type | |
511 { | |
512 Loc loc; | |
513 Array idents; // array of Identifier's representing ident.ident.ident etc. | |
514 | |
515 TypeQualified(TY ty, Loc loc); | |
516 void syntaxCopyHelper(TypeQualified *t); | |
517 void addIdent(Identifier *ident); | |
518 void toCBuffer2Helper(OutBuffer *buf, HdrGenState *hgs); | |
519 d_uns64 size(Loc loc); | |
520 void resolveHelper(Loc loc, Scope *sc, Dsymbol *s, Dsymbol *scopesym, | |
521 Expression **pe, Type **pt, Dsymbol **ps); | |
522 }; | |
523 | |
524 struct TypeIdentifier : TypeQualified | |
525 { | |
526 Identifier *ident; | |
527 | |
528 TypeIdentifier(Loc loc, Identifier *ident); | |
529 Type *syntaxCopy(); | |
530 //char *toChars(); | |
1228
79758fd2f48a
Added Doxygen file.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1192
diff
changeset
|
531 void toDecoBuffer(OutBuffer *buf, bool mangle); |
159 | 532 void toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod); |
533 void resolve(Loc loc, Scope *sc, Expression **pe, Type **pt, Dsymbol **ps); | |
534 Dsymbol *toDsymbol(Scope *sc); | |
535 Type *semantic(Loc loc, Scope *sc); | |
536 MATCH deduceType(Scope *sc, Type *tparam, TemplateParameters *parameters, Objects *dedtypes); | |
537 Type *reliesOnTident(); | |
538 Expression *toExpression(); | |
539 }; | |
540 | |
541 /* Similar to TypeIdentifier, but with a TemplateInstance as the root | |
542 */ | |
543 struct TypeInstance : TypeQualified | |
544 { | |
545 TemplateInstance *tempinst; | |
546 | |
547 TypeInstance(Loc loc, TemplateInstance *tempinst); | |
548 Type *syntaxCopy(); | |
549 //char *toChars(); | |
1228
79758fd2f48a
Added Doxygen file.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1192
diff
changeset
|
550 //void toDecoBuffer(OutBuffer *buf, bool mangle); |
159 | 551 void toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod); |
552 void resolve(Loc loc, Scope *sc, Expression **pe, Type **pt, Dsymbol **ps); | |
553 Type *semantic(Loc loc, Scope *sc); | |
875
330f999ade44
Merged DMD 1.038
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
797
diff
changeset
|
554 Dsymbol *toDsymbol(Scope *sc); |
159 | 555 MATCH deduceType(Scope *sc, Type *tparam, TemplateParameters *parameters, Objects *dedtypes); |
556 }; | |
557 | |
558 struct TypeTypeof : TypeQualified | |
559 { | |
560 Expression *exp; | |
561 | |
562 TypeTypeof(Loc loc, Expression *exp); | |
563 Type *syntaxCopy(); | |
564 Dsymbol *toDsymbol(Scope *sc); | |
565 void toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod); | |
566 Type *semantic(Loc loc, Scope *sc); | |
567 d_uns64 size(Loc loc); | |
568 }; | |
569 | |
570 struct TypeStruct : Type | |
571 { | |
572 StructDeclaration *sym; | |
573 | |
574 TypeStruct(StructDeclaration *sym); | |
575 d_uns64 size(Loc loc); | |
576 unsigned alignsize(); | |
577 char *toChars(); | |
578 Type *syntaxCopy(); | |
579 Type *semantic(Loc loc, Scope *sc); | |
580 Dsymbol *toDsymbol(Scope *sc); | |
1228
79758fd2f48a
Added Doxygen file.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1192
diff
changeset
|
581 void toDecoBuffer(OutBuffer *buf, bool mangle); |
159 | 582 void toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod); |
583 Expression *dotExp(Scope *sc, Expression *e, Identifier *ident); | |
584 unsigned memalign(unsigned salign); | |
585 Expression *defaultInit(Loc loc); | |
586 int isZeroInit(); | |
587 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
|
588 #if IN_DMD |
159 | 589 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
|
590 #endif |
159 | 591 MATCH deduceType(Scope *sc, Type *tparam, TemplateParameters *parameters, Objects *dedtypes); |
592 TypeInfoDeclaration *getTypeInfoDeclaration(); | |
593 int hasPointers(); | |
594 | |
1146
1860414bf3b7
* Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1103
diff
changeset
|
595 #if IN_DMD |
159 | 596 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
|
597 #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
|
598 // 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
|
599 // 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
|
600 // 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
|
601 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
|
602 #endif |
159 | 603 }; |
604 | |
605 struct TypeEnum : Type | |
606 { | |
607 EnumDeclaration *sym; | |
608 | |
609 TypeEnum(EnumDeclaration *sym); | |
610 d_uns64 size(Loc loc); | |
611 unsigned alignsize(); | |
612 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
|
613 Type *syntaxCopy(); |
159 | 614 Type *semantic(Loc loc, Scope *sc); |
615 Dsymbol *toDsymbol(Scope *sc); | |
1228
79758fd2f48a
Added Doxygen file.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1192
diff
changeset
|
616 void toDecoBuffer(OutBuffer *buf, bool mangle); |
159 | 617 void toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod); |
618 Expression *dotExp(Scope *sc, Expression *e, Identifier *ident); | |
619 Expression *getProperty(Loc loc, Identifier *ident); | |
620 int isintegral(); | |
621 int isfloating(); | |
622 int isscalar(); | |
623 int isunsigned(); | |
624 MATCH implicitConvTo(Type *to); | |
625 Type *toBasetype(); | |
626 Expression *defaultInit(Loc loc); | |
627 int isZeroInit(); | |
628 MATCH deduceType(Scope *sc, Type *tparam, TemplateParameters *parameters, Objects *dedtypes); | |
629 TypeInfoDeclaration *getTypeInfoDeclaration(); | |
630 int hasPointers(); | |
631 | |
1146
1860414bf3b7
* Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1103
diff
changeset
|
632 #if IN_DMD |
159 | 633 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
|
634 #endif |
159 | 635 }; |
636 | |
637 struct TypeTypedef : Type | |
638 { | |
639 TypedefDeclaration *sym; | |
640 | |
641 TypeTypedef(TypedefDeclaration *sym); | |
642 Type *syntaxCopy(); | |
643 d_uns64 size(Loc loc); | |
644 unsigned alignsize(); | |
645 char *toChars(); | |
646 Type *semantic(Loc loc, Scope *sc); | |
647 Dsymbol *toDsymbol(Scope *sc); | |
1228
79758fd2f48a
Added Doxygen file.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1192
diff
changeset
|
648 void toDecoBuffer(OutBuffer *buf, bool mangle); |
159 | 649 void toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod); |
650 Expression *dotExp(Scope *sc, Expression *e, Identifier *ident); | |
651 Expression *getProperty(Loc loc, Identifier *ident); | |
652 int isbit(); | |
653 int isintegral(); | |
654 int isfloating(); | |
655 int isreal(); | |
656 int isimaginary(); | |
657 int iscomplex(); | |
658 int isscalar(); | |
659 int isunsigned(); | |
660 int checkBoolean(); | |
661 Type *toBasetype(); | |
662 MATCH implicitConvTo(Type *to); | |
663 Expression *defaultInit(Loc loc); | |
664 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
|
665 #if IN_DMD |
159 | 666 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
|
667 #endif |
159 | 668 MATCH deduceType(Scope *sc, Type *tparam, TemplateParameters *parameters, Objects *dedtypes); |
669 TypeInfoDeclaration *getTypeInfoDeclaration(); | |
670 int hasPointers(); | |
671 | |
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 #if IN_DMD |
159 | 673 type *toCtype(); |
674 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
|
675 #endif |
159 | 676 }; |
677 | |
678 struct TypeClass : Type | |
679 { | |
680 ClassDeclaration *sym; | |
681 | |
682 TypeClass(ClassDeclaration *sym); | |
683 d_uns64 size(Loc loc); | |
684 char *toChars(); | |
685 Type *syntaxCopy(); | |
686 Type *semantic(Loc loc, Scope *sc); | |
687 Dsymbol *toDsymbol(Scope *sc); | |
1228
79758fd2f48a
Added Doxygen file.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1192
diff
changeset
|
688 void toDecoBuffer(OutBuffer *buf, bool mangle); |
159 | 689 void toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod); |
690 Expression *dotExp(Scope *sc, Expression *e, Identifier *ident); | |
691 ClassDeclaration *isClassHandle(); | |
692 int isBaseOf(Type *t, int *poffset); | |
693 MATCH implicitConvTo(Type *to); | |
694 Expression *defaultInit(Loc loc); | |
695 int isZeroInit(); | |
696 MATCH deduceType(Scope *sc, Type *tparam, TemplateParameters *parameters, Objects *dedtypes); | |
697 int isauto(); | |
698 int checkBoolean(); | |
699 TypeInfoDeclaration *getTypeInfoDeclaration(); | |
700 int hasPointers(); | |
701 | |
1146
1860414bf3b7
* Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1103
diff
changeset
|
702 #if IN_DMD |
159 | 703 type *toCtype(); |
704 | |
705 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
|
706 #endif |
159 | 707 }; |
708 | |
709 struct TypeTuple : Type | |
710 { | |
711 Arguments *arguments; // types making up the tuple | |
712 | |
713 TypeTuple(Arguments *arguments); | |
714 TypeTuple(Expressions *exps); | |
715 Type *syntaxCopy(); | |
716 Type *semantic(Loc loc, Scope *sc); | |
717 int equals(Object *o); | |
718 Type *reliesOnTident(); | |
719 void toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod); | |
1228
79758fd2f48a
Added Doxygen file.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1192
diff
changeset
|
720 void toDecoBuffer(OutBuffer *buf, bool mangle); |
159 | 721 Expression *getProperty(Loc loc, Identifier *ident); |
722 TypeInfoDeclaration *getTypeInfoDeclaration(); | |
723 }; | |
724 | |
725 struct TypeSlice : Type | |
726 { | |
727 Expression *lwr; | |
728 Expression *upr; | |
729 | |
730 TypeSlice(Type *next, Expression *lwr, Expression *upr); | |
731 Type *syntaxCopy(); | |
732 Type *semantic(Loc loc, Scope *sc); | |
733 void resolve(Loc loc, Scope *sc, Expression **pe, Type **pt, Dsymbol **ps); | |
734 void toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod); | |
735 }; | |
736 | |
737 /**************************************************************/ | |
738 | |
739 //enum InOut { None, In, Out, InOut, Lazy }; | |
740 | |
741 struct Argument : Object | |
742 { | |
743 //enum InOut inout; | |
744 unsigned storageClass; | |
745 Type *type; | |
746 Identifier *ident; | |
747 Expression *defaultArg; | |
748 | |
749 Argument(unsigned storageClass, Type *type, Identifier *ident, Expression *defaultArg); | |
750 Argument *syntaxCopy(); | |
751 Type *isLazyArray(); | |
1228
79758fd2f48a
Added Doxygen file.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1192
diff
changeset
|
752 void toDecoBuffer(OutBuffer *buf, bool mangle); |
159 | 753 static Arguments *arraySyntaxCopy(Arguments *args); |
754 static char *argsTypesToChars(Arguments *args, int varargs); | |
755 static void argsToCBuffer(OutBuffer *buf, HdrGenState *hgs, Arguments *arguments, int varargs); | |
1228
79758fd2f48a
Added Doxygen file.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1192
diff
changeset
|
756 static void argsToDecoBuffer(OutBuffer *buf, Arguments *arguments, bool mangle); |
159 | 757 static size_t dim(Arguments *arguments); |
758 static Argument *getNth(Arguments *arguments, size_t nth, size_t *pn = NULL); | |
759 }; | |
760 | |
761 extern int PTRSIZE; | |
762 extern int REALSIZE; | |
763 extern int REALPAD; | |
764 extern int Tsize_t; | |
765 extern int Tptrdiff_t; | |
766 | |
767 #endif /* DMD_MTYPE_H */ |