Mercurial > projects > ldc
annotate dmd/mtype.h @ 1587:def7a1d494fd
Merge DMD 1.051
author | Christian Kamm <kamm incasoftware de> |
---|---|
date | Fri, 06 Nov 2009 23:58:01 +0100 |
parents | 05c235309d6f |
children | a413ae7329bf |
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 |
1051
dc608dc33081
Make IrFuncTy a member of TypeFunction. Reset between modules compiled in the
Christian Kamm <kamm incasoftware de>
parents:
1029
diff
changeset
|
25 #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
|
26 namespace llvm { class Type; } |
1364
46f6365a50d7
Added IrTypeFunction and IrTypeDelegate and eliminated IrDType. This means the Type::ir field can be removed. It's the final part needed for the move to a slightly more sane type system. Now the whole thing just needs to be cleaned up :P
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents:
1245
diff
changeset
|
27 class 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
|
28 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
|
29 #endif |
173
db9890b3fb64
[svn r189] moving IR data back into DMD frontend nodes
ChristianK
parents:
162
diff
changeset
|
30 |
159 | 31 struct Scope; |
32 struct Identifier; | |
33 struct Expression; | |
34 struct StructDeclaration; | |
35 struct ClassDeclaration; | |
36 struct VarDeclaration; | |
37 struct EnumDeclaration; | |
38 struct TypedefDeclaration; | |
39 struct TypeInfoDeclaration; | |
40 struct Dsymbol; | |
41 struct TemplateInstance; | |
1103
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1051
diff
changeset
|
42 struct CppMangleState; |
159 | 43 enum LINK; |
44 | |
45 struct TypeBasic; | |
46 struct HdrGenState; | |
1103
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1051
diff
changeset
|
47 struct Argument; |
159 | 48 |
49 // Back end | |
50 #if IN_GCC | |
51 union tree_node; typedef union tree_node TYPE; | |
52 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
|
53 #endif |
1860414bf3b7
* Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1103
diff
changeset
|
54 |
1860414bf3b7
* Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1103
diff
changeset
|
55 #if IN_DMD |
159 | 56 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
|
57 struct Symbol; |
159 | 58 #endif |
59 | |
60 enum TY | |
61 { | |
62 Tarray, // dynamic array | |
63 Tsarray, // static array | |
64 Taarray, // associative array | |
65 Tpointer, | |
66 Treference, | |
67 Tfunction, | |
68 Tident, | |
69 Tclass, | |
70 Tstruct, | |
71 Tenum, | |
72 Ttypedef, | |
73 Tdelegate, | |
74 | |
75 Tnone, | |
76 Tvoid, | |
77 Tint8, | |
78 Tuns8, | |
79 Tint16, | |
80 Tuns16, | |
81 Tint32, | |
82 Tuns32, | |
83 Tint64, | |
84 Tuns64, | |
85 Tfloat32, | |
86 Tfloat64, | |
87 Tfloat80, | |
88 | |
89 Timaginary32, | |
90 Timaginary64, | |
91 Timaginary80, | |
92 | |
93 Tcomplex32, | |
94 Tcomplex64, | |
95 Tcomplex80, | |
96 | |
97 Tbit, | |
98 Tbool, | |
99 Tchar, | |
100 Twchar, | |
101 Tdchar, | |
102 | |
103 Terror, | |
104 Tinstance, | |
105 Ttypeof, | |
106 Ttuple, | |
107 Tslice, | |
1103
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1051
diff
changeset
|
108 Treturn, |
159 | 109 TMAX |
110 }; | |
111 | |
112 #define Tascii Tchar | |
113 | |
114 extern int Tsize_t; | |
115 extern int Tptrdiff_t; | |
116 | |
1103
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1051
diff
changeset
|
117 |
159 | 118 struct Type : Object |
119 { | |
120 TY ty; | |
1103
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1051
diff
changeset
|
121 unsigned char mod; // modifiers MODxxxx |
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1051
diff
changeset
|
122 /* 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
|
123 */ |
159 | 124 #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
|
125 #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
|
126 #define MODshared 2 // type is shared |
159 | 127 char *deco; |
128 Type *pto; // merged pointer to this type | |
129 Type *rto; // reference to this type | |
130 Type *arrayof; // array of this type | |
131 TypeInfoDeclaration *vtinfo; // TypeInfo object for this Type | |
132 | |
1146
1860414bf3b7
* Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1103
diff
changeset
|
133 #if IN_DMD |
159 | 134 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
|
135 #endif |
159 | 136 |
137 #define tvoid basic[Tvoid] | |
138 #define tint8 basic[Tint8] | |
139 #define tuns8 basic[Tuns8] | |
140 #define tint16 basic[Tint16] | |
141 #define tuns16 basic[Tuns16] | |
142 #define tint32 basic[Tint32] | |
143 #define tuns32 basic[Tuns32] | |
144 #define tint64 basic[Tint64] | |
145 #define tuns64 basic[Tuns64] | |
146 #define tfloat32 basic[Tfloat32] | |
147 #define tfloat64 basic[Tfloat64] | |
148 #define tfloat80 basic[Tfloat80] | |
149 | |
150 #define timaginary32 basic[Timaginary32] | |
151 #define timaginary64 basic[Timaginary64] | |
152 #define timaginary80 basic[Timaginary80] | |
153 | |
154 #define tcomplex32 basic[Tcomplex32] | |
155 #define tcomplex64 basic[Tcomplex64] | |
156 #define tcomplex80 basic[Tcomplex80] | |
157 | |
158 #define tbit basic[Tbit] | |
159 #define tbool basic[Tbool] | |
160 #define tchar basic[Tchar] | |
161 #define twchar basic[Twchar] | |
162 #define tdchar basic[Tdchar] | |
163 | |
164 // Some special types | |
165 #define tshiftcnt tint32 // right side of shift expression | |
166 // #define tboolean tint32 // result of boolean expression | |
167 #define tboolean tbool // result of boolean expression | |
168 #define tindex tint32 // array/ptr index | |
169 static Type *tvoidptr; // void* | |
170 #define terror basic[Terror] // for error recovery | |
171 | |
172 #define tsize_t basic[Tsize_t] // matches size_t alias | |
173 #define tptrdiff_t basic[Tptrdiff_t] // matches ptrdiff_t alias | |
174 #define thash_t tsize_t // matches hash_t alias | |
175 | |
176 static ClassDeclaration *typeinfo; | |
177 static ClassDeclaration *typeinfoclass; | |
178 static ClassDeclaration *typeinfointerface; | |
179 static ClassDeclaration *typeinfostruct; | |
180 static ClassDeclaration *typeinfotypedef; | |
181 static ClassDeclaration *typeinfopointer; | |
182 static ClassDeclaration *typeinfoarray; | |
183 static ClassDeclaration *typeinfostaticarray; | |
184 static ClassDeclaration *typeinfoassociativearray; | |
185 static ClassDeclaration *typeinfoenum; | |
186 static ClassDeclaration *typeinfofunction; | |
187 static ClassDeclaration *typeinfodelegate; | |
188 static ClassDeclaration *typeinfotypelist; | |
189 | |
190 static Type *basic[TMAX]; | |
191 static unsigned char mangleChar[TMAX]; | |
192 static StringTable stringtable; | |
1245
465a77c904d4
Fixed all issues preventing Tango 0.99.8 to compile with `sh build-tango.sh --verbose ldc'.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1228
diff
changeset
|
193 #if IN_LLVM |
465a77c904d4
Fixed all issues preventing Tango 0.99.8 to compile with `sh build-tango.sh --verbose ldc'.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1228
diff
changeset
|
194 static StringTable deco_stringtable; |
465a77c904d4
Fixed all issues preventing Tango 0.99.8 to compile with `sh build-tango.sh --verbose ldc'.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1228
diff
changeset
|
195 #endif |
159 | 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(); |
1367
8026319762be
Merged DMD 1.045 !!!
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents:
1364
diff
changeset
|
225 Type *merge2(); |
159 | 226 virtual void toCBuffer(OutBuffer *buf, Identifier *ident, HdrGenState *hgs); |
227 virtual void toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod); | |
228 void toCBuffer3(OutBuffer *buf, HdrGenState *hgs, int mod); | |
229 virtual int isbit(); | |
230 virtual int isintegral(); | |
231 virtual int isfloating(); // real, imaginary, or complex | |
232 virtual int isreal(); | |
233 virtual int isimaginary(); | |
234 virtual int iscomplex(); | |
235 virtual int isscalar(); | |
236 virtual int isunsigned(); | |
1530
05c235309d6f
Make the auto storage class never have the same meaning as scope.
Christian Kamm <kamm incasoftware de>
parents:
1372
diff
changeset
|
237 virtual int isscope(); |
159 | 238 virtual int isString(); |
239 virtual int checkBoolean(); // if can be converted to boolean value | |
240 void checkDeprecated(Loc loc, Scope *sc); | |
241 Type *pointerTo(); | |
242 Type *referenceTo(); | |
243 Type *arrayOf(); | |
244 virtual Dsymbol *toDsymbol(Scope *sc); | |
245 virtual Type *toBasetype(); | |
246 virtual int isBaseOf(Type *t, int *poffset); | |
247 virtual MATCH implicitConvTo(Type *to); | |
248 virtual ClassDeclaration *isClassHandle(); | |
249 virtual Expression *getProperty(Loc loc, Identifier *ident); | |
250 virtual Expression *dotExp(Scope *sc, Expression *e, Identifier *ident); | |
251 virtual unsigned memalign(unsigned salign); | |
252 virtual Expression *defaultInit(Loc loc = 0); | |
1367
8026319762be
Merged DMD 1.045 !!!
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents:
1364
diff
changeset
|
253 virtual int isZeroInit(Loc loc = 0); // 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
|
254 #if IN_DMD |
159 | 255 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
|
256 #endif |
159 | 257 Identifier *getTypeInfoIdent(int internal); |
258 virtual MATCH deduceType(Scope *sc, Type *tparam, TemplateParameters *parameters, Objects *dedtypes); | |
259 virtual void resolve(Loc loc, Scope *sc, Expression **pe, Type **pt, Dsymbol **ps); | |
260 Expression *getInternalTypeInfo(Scope *sc); | |
261 Expression *getTypeInfo(Scope *sc); | |
262 virtual TypeInfoDeclaration *getTypeInfoDeclaration(); | |
263 virtual int builtinTypeInfo(); | |
264 virtual Type *reliesOnTident(); | |
265 virtual Expression *toExpression(); | |
266 virtual int hasPointers(); | |
1103
b30fe7e1dbb9
- Updated to DMD frontend 1.041.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1051
diff
changeset
|
267 Type *next; |
159 | 268 Type *nextOf() { return next; } |
269 | |
1372
229e02867307
Fix format-string bugs by adding __attribute__((__format__)) in all applicable
Frits van Bommel <fvbommel wxs.nl>
parents:
1367
diff
changeset
|
270 static void error(Loc loc, const char *format, ...) IS_PRINTF(2); |
229e02867307
Fix format-string bugs by adding __attribute__((__format__)) in all applicable
Frits van Bommel <fvbommel wxs.nl>
parents:
1367
diff
changeset
|
271 static void warning(Loc loc, const char *format, ...) IS_PRINTF(2); |
159 | 272 |
1146
1860414bf3b7
* Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1103
diff
changeset
|
273 #if IN_DMD |
159 | 274 // For backend |
275 virtual unsigned totym(); | |
276 virtual type *toCtype(); | |
277 virtual type *toCParamtype(); | |
278 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
|
279 #endif |
159 | 280 |
281 // For eliminating dynamic_cast | |
282 virtual TypeBasic *isTypeBasic(); | |
173
db9890b3fb64
[svn r189] moving IR data back into DMD frontend nodes
ChristianK
parents:
162
diff
changeset
|
283 |
1146
1860414bf3b7
* Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1103
diff
changeset
|
284 #if IN_LLVM |
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 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
|
287 #endif |
159 | 288 }; |
289 | |
290 struct TypeBasic : Type | |
291 { | |
658
50383e476c7e
Upgraded frontend to DMD 1.035
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
508
diff
changeset
|
292 const char *dstring; |
50383e476c7e
Upgraded frontend to DMD 1.035
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
508
diff
changeset
|
293 const char *cstring; |
159 | 294 unsigned flags; |
295 | |
296 TypeBasic(TY ty); | |
297 Type *syntaxCopy(); | |
298 d_uns64 size(Loc loc); | |
299 unsigned alignsize(); | |
300 Expression *getProperty(Loc loc, Identifier *ident); | |
301 Expression *dotExp(Scope *sc, Expression *e, Identifier *ident); | |
302 char *toChars(); | |
303 void toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod); | |
304 int isintegral(); | |
305 int isbit(); | |
306 int isfloating(); | |
307 int isreal(); | |
308 int isimaginary(); | |
309 int iscomplex(); | |
310 int isscalar(); | |
311 int isunsigned(); | |
312 MATCH implicitConvTo(Type *to); | |
313 Expression *defaultInit(Loc loc); | |
1367
8026319762be
Merged DMD 1.045 !!!
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents:
1364
diff
changeset
|
314 int isZeroInit(Loc loc); |
159 | 315 int builtinTypeInfo(); |
316 | |
317 // For eliminating dynamic_cast | |
318 TypeBasic *isTypeBasic(); | |
319 }; | |
320 | |
321 struct TypeArray : Type | |
322 { | |
323 TypeArray(TY ty, Type *next); | |
324 Expression *dotExp(Scope *sc, Expression *e, Identifier *ident); | |
325 }; | |
326 | |
327 // Static array, one with a fixed dimension | |
328 struct TypeSArray : TypeArray | |
329 { | |
330 Expression *dim; | |
331 | |
332 TypeSArray(Type *t, Expression *dim); | |
333 Type *syntaxCopy(); | |
334 d_uns64 size(Loc loc); | |
335 unsigned alignsize(); | |
336 Type *semantic(Loc loc, Scope *sc); | |
337 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
|
338 void toDecoBuffer(OutBuffer *buf, bool mangle); |
159 | 339 void toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod); |
340 Expression *dotExp(Scope *sc, Expression *e, Identifier *ident); | |
341 int isString(); | |
1367
8026319762be
Merged DMD 1.045 !!!
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents:
1364
diff
changeset
|
342 int isZeroInit(Loc loc); |
159 | 343 unsigned memalign(unsigned salign); |
344 MATCH implicitConvTo(Type *to); | |
345 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
|
346 #if IN_DMD |
159 | 347 dt_t **toDt(dt_t **pdt); |
348 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
|
349 #endif |
159 | 350 MATCH deduceType(Scope *sc, Type *tparam, TemplateParameters *parameters, Objects *dedtypes); |
351 TypeInfoDeclaration *getTypeInfoDeclaration(); | |
352 Expression *toExpression(); | |
353 int hasPointers(); | |
354 | |
1146
1860414bf3b7
* Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1103
diff
changeset
|
355 #if IN_DMD |
159 | 356 type *toCtype(); |
357 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
|
358 #endif |
159 | 359 }; |
360 | |
361 // Dynamic array, no dimension | |
362 struct TypeDArray : TypeArray | |
363 { | |
364 TypeDArray(Type *t); | |
365 Type *syntaxCopy(); | |
366 d_uns64 size(Loc loc); | |
367 unsigned alignsize(); | |
368 Type *semantic(Loc loc, Scope *sc); | |
1228
79758fd2f48a
Added Doxygen file.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1192
diff
changeset
|
369 void toDecoBuffer(OutBuffer *buf, bool mangle); |
159 | 370 void toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod); |
371 Expression *dotExp(Scope *sc, Expression *e, Identifier *ident); | |
372 int isString(); | |
1367
8026319762be
Merged DMD 1.045 !!!
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents:
1364
diff
changeset
|
373 int isZeroInit(Loc loc); |
159 | 374 int checkBoolean(); |
375 MATCH implicitConvTo(Type *to); | |
376 Expression *defaultInit(Loc loc); | |
377 int builtinTypeInfo(); | |
378 TypeInfoDeclaration *getTypeInfoDeclaration(); | |
379 int hasPointers(); | |
380 | |
1146
1860414bf3b7
* Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1103
diff
changeset
|
381 #if IN_DMD |
159 | 382 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
|
383 #endif |
159 | 384 }; |
385 | |
386 struct TypeAArray : TypeArray | |
387 { | |
388 Type *index; // key type for type checking | |
389 Type *key; // actual key type | |
390 | |
391 TypeAArray(Type *t, Type *index); | |
392 Type *syntaxCopy(); | |
393 d_uns64 size(Loc loc); | |
394 Type *semantic(Loc loc, Scope *sc); | |
336 | 395 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
|
396 void toDecoBuffer(OutBuffer *buf, bool mangle); |
159 | 397 void toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod); |
398 Expression *dotExp(Scope *sc, Expression *e, Identifier *ident); | |
399 Expression *defaultInit(Loc loc); | |
400 MATCH deduceType(Scope *sc, Type *tparam, TemplateParameters *parameters, Objects *dedtypes); | |
1367
8026319762be
Merged DMD 1.045 !!!
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents:
1364
diff
changeset
|
401 int isZeroInit(Loc loc); |
159 | 402 int checkBoolean(); |
403 TypeInfoDeclaration *getTypeInfoDeclaration(); | |
404 int hasPointers(); | |
405 | |
1146
1860414bf3b7
* Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1103
diff
changeset
|
406 #if IN_DMD |
159 | 407 // 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
|
408 Symbol *aaGetSymbol(const char *func, int flags); |
159 | 409 |
410 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
|
411 #endif |
159 | 412 }; |
413 | |
414 struct TypePointer : Type | |
415 { | |
416 TypePointer(Type *t); | |
417 Type *syntaxCopy(); | |
418 Type *semantic(Loc loc, Scope *sc); | |
419 d_uns64 size(Loc loc); | |
420 void toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod); | |
421 MATCH implicitConvTo(Type *to); | |
422 int isscalar(); | |
663
6aaa3d3c1183
First part of rename to LDC.
Christian Kamm <kamm incasoftware de>
parents:
658
diff
changeset
|
423 // 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
|
424 int isunsigned() { return TRUE; }; |
159 | 425 Expression *defaultInit(Loc loc); |
1367
8026319762be
Merged DMD 1.045 !!!
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents:
1364
diff
changeset
|
426 int isZeroInit(Loc loc); |
159 | 427 TypeInfoDeclaration *getTypeInfoDeclaration(); |
428 int hasPointers(); | |
429 | |
1146
1860414bf3b7
* Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1103
diff
changeset
|
430 #if IN_DMD |
159 | 431 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
|
432 #endif |
159 | 433 }; |
434 | |
435 struct TypeReference : Type | |
436 { | |
437 TypeReference(Type *t); | |
438 Type *syntaxCopy(); | |
439 d_uns64 size(Loc loc); | |
440 void toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod); | |
441 Expression *dotExp(Scope *sc, Expression *e, Identifier *ident); | |
442 Expression *defaultInit(Loc loc); | |
1367
8026319762be
Merged DMD 1.045 !!!
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents:
1364
diff
changeset
|
443 int isZeroInit(Loc loc); |
159 | 444 }; |
445 | |
446 enum RET | |
447 { | |
448 RETregs = 1, // returned in registers | |
449 RETstack = 2, // returned on stack | |
450 }; | |
451 | |
452 struct TypeFunction : Type | |
453 { | |
454 Arguments *parameters; // function parameters | |
455 int varargs; // 1: T t, ...) style for variable number of arguments | |
456 // 2: T t ...) style for variable number of arguments | |
457 enum LINK linkage; // calling convention | |
458 | |
459 int inuse; | |
460 | |
461 TypeFunction(Arguments *parameters, Type *treturn, int varargs, enum LINK linkage); | |
462 Type *syntaxCopy(); | |
463 Type *semantic(Loc loc, Scope *sc); | |
1228
79758fd2f48a
Added Doxygen file.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1192
diff
changeset
|
464 void toDecoBuffer(OutBuffer *buf, bool mangle); |
159 | 465 void toCBuffer(OutBuffer *buf, Identifier *ident, HdrGenState *hgs); |
466 void toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod); | |
467 MATCH deduceType(Scope *sc, Type *tparam, TemplateParameters *parameters, Objects *dedtypes); | |
468 TypeInfoDeclaration *getTypeInfoDeclaration(); | |
469 Type *reliesOnTident(); | |
470 | |
471 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
|
472 #if IN_DMD |
159 | 473 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
|
474 #endif |
1860414bf3b7
* Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1103
diff
changeset
|
475 |
159 | 476 enum RET retStyle(); |
477 | |
1146
1860414bf3b7
* Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1103
diff
changeset
|
478 #if IN_DMD |
159 | 479 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
|
480 #elif IN_LLVM |
663
6aaa3d3c1183
First part of rename to LDC.
Christian Kamm <kamm incasoftware de>
parents:
658
diff
changeset
|
481 // LDC |
1051
dc608dc33081
Make IrFuncTy a member of TypeFunction. Reset between modules compiled in the
Christian Kamm <kamm incasoftware de>
parents:
1029
diff
changeset
|
482 IrFuncTy fty; |
1228
79758fd2f48a
Added Doxygen file.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1192
diff
changeset
|
483 |
79758fd2f48a
Added Doxygen file.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1192
diff
changeset
|
484 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
|
485 #endif |
159 | 486 }; |
487 | |
488 struct TypeDelegate : Type | |
489 { | |
490 TypeDelegate(Type *t); | |
491 Type *syntaxCopy(); | |
492 Type *semantic(Loc loc, Scope *sc); | |
493 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
|
494 unsigned alignsize(); // added in LDC |
159 | 495 void toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod); |
496 Expression *defaultInit(Loc loc); | |
1367
8026319762be
Merged DMD 1.045 !!!
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents:
1364
diff
changeset
|
497 int isZeroInit(Loc loc); |
159 | 498 int checkBoolean(); |
499 TypeInfoDeclaration *getTypeInfoDeclaration(); | |
500 Expression *dotExp(Scope *sc, Expression *e, Identifier *ident); | |
501 int hasPointers(); | |
502 | |
1146
1860414bf3b7
* Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1103
diff
changeset
|
503 #if IN_DMD |
159 | 504 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
|
505 #endif |
159 | 506 }; |
507 | |
508 struct TypeQualified : Type | |
509 { | |
510 Loc loc; | |
511 Array idents; // array of Identifier's representing ident.ident.ident etc. | |
512 | |
513 TypeQualified(TY ty, Loc loc); | |
514 void syntaxCopyHelper(TypeQualified *t); | |
515 void addIdent(Identifier *ident); | |
516 void toCBuffer2Helper(OutBuffer *buf, HdrGenState *hgs); | |
517 d_uns64 size(Loc loc); | |
518 void resolveHelper(Loc loc, Scope *sc, Dsymbol *s, Dsymbol *scopesym, | |
519 Expression **pe, Type **pt, Dsymbol **ps); | |
520 }; | |
521 | |
522 struct TypeIdentifier : TypeQualified | |
523 { | |
524 Identifier *ident; | |
525 | |
526 TypeIdentifier(Loc loc, Identifier *ident); | |
527 Type *syntaxCopy(); | |
528 //char *toChars(); | |
1228
79758fd2f48a
Added Doxygen file.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1192
diff
changeset
|
529 void toDecoBuffer(OutBuffer *buf, bool mangle); |
159 | 530 void toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod); |
531 void resolve(Loc loc, Scope *sc, Expression **pe, Type **pt, Dsymbol **ps); | |
532 Dsymbol *toDsymbol(Scope *sc); | |
533 Type *semantic(Loc loc, Scope *sc); | |
534 MATCH deduceType(Scope *sc, Type *tparam, TemplateParameters *parameters, Objects *dedtypes); | |
535 Type *reliesOnTident(); | |
536 Expression *toExpression(); | |
537 }; | |
538 | |
539 /* Similar to TypeIdentifier, but with a TemplateInstance as the root | |
540 */ | |
541 struct TypeInstance : TypeQualified | |
542 { | |
543 TemplateInstance *tempinst; | |
544 | |
545 TypeInstance(Loc loc, TemplateInstance *tempinst); | |
546 Type *syntaxCopy(); | |
547 //char *toChars(); | |
1228
79758fd2f48a
Added Doxygen file.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1192
diff
changeset
|
548 //void toDecoBuffer(OutBuffer *buf, bool mangle); |
159 | 549 void toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod); |
550 void resolve(Loc loc, Scope *sc, Expression **pe, Type **pt, Dsymbol **ps); | |
551 Type *semantic(Loc loc, Scope *sc); | |
875
330f999ade44
Merged DMD 1.038
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
797
diff
changeset
|
552 Dsymbol *toDsymbol(Scope *sc); |
159 | 553 MATCH deduceType(Scope *sc, Type *tparam, TemplateParameters *parameters, Objects *dedtypes); |
554 }; | |
555 | |
556 struct TypeTypeof : TypeQualified | |
557 { | |
558 Expression *exp; | |
559 | |
560 TypeTypeof(Loc loc, Expression *exp); | |
561 Type *syntaxCopy(); | |
562 Dsymbol *toDsymbol(Scope *sc); | |
563 void toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod); | |
1587 | 564 void toDecoBuffer(OutBuffer *buf, bool mangle); |
159 | 565 Type *semantic(Loc loc, Scope *sc); |
566 d_uns64 size(Loc loc); | |
567 }; | |
568 | |
569 struct TypeStruct : Type | |
570 { | |
571 StructDeclaration *sym; | |
572 | |
573 TypeStruct(StructDeclaration *sym); | |
574 d_uns64 size(Loc loc); | |
575 unsigned alignsize(); | |
576 char *toChars(); | |
577 Type *syntaxCopy(); | |
578 Type *semantic(Loc loc, Scope *sc); | |
579 Dsymbol *toDsymbol(Scope *sc); | |
1228
79758fd2f48a
Added Doxygen file.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1192
diff
changeset
|
580 void toDecoBuffer(OutBuffer *buf, bool mangle); |
159 | 581 void toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod); |
582 Expression *dotExp(Scope *sc, Expression *e, Identifier *ident); | |
583 unsigned memalign(unsigned salign); | |
584 Expression *defaultInit(Loc loc); | |
1367
8026319762be
Merged DMD 1.045 !!!
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents:
1364
diff
changeset
|
585 int isZeroInit(Loc loc); |
159 | 586 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
|
587 #if IN_DMD |
159 | 588 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
|
589 #endif |
159 | 590 MATCH deduceType(Scope *sc, Type *tparam, TemplateParameters *parameters, Objects *dedtypes); |
591 TypeInfoDeclaration *getTypeInfoDeclaration(); | |
592 int hasPointers(); | |
593 | |
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 #if IN_DMD |
159 | 595 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
|
596 #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
|
597 // 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
|
598 // 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
|
599 // 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
|
600 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
|
601 #endif |
159 | 602 }; |
603 | |
604 struct TypeEnum : Type | |
605 { | |
606 EnumDeclaration *sym; | |
607 | |
608 TypeEnum(EnumDeclaration *sym); | |
609 d_uns64 size(Loc loc); | |
610 unsigned alignsize(); | |
611 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
|
612 Type *syntaxCopy(); |
159 | 613 Type *semantic(Loc loc, Scope *sc); |
614 Dsymbol *toDsymbol(Scope *sc); | |
1228
79758fd2f48a
Added Doxygen file.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1192
diff
changeset
|
615 void toDecoBuffer(OutBuffer *buf, bool mangle); |
159 | 616 void toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod); |
617 Expression *dotExp(Scope *sc, Expression *e, Identifier *ident); | |
618 Expression *getProperty(Loc loc, Identifier *ident); | |
619 int isintegral(); | |
620 int isfloating(); | |
621 int isscalar(); | |
622 int isunsigned(); | |
623 MATCH implicitConvTo(Type *to); | |
624 Type *toBasetype(); | |
625 Expression *defaultInit(Loc loc); | |
1367
8026319762be
Merged DMD 1.045 !!!
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents:
1364
diff
changeset
|
626 int isZeroInit(Loc loc); |
159 | 627 MATCH deduceType(Scope *sc, Type *tparam, TemplateParameters *parameters, Objects *dedtypes); |
628 TypeInfoDeclaration *getTypeInfoDeclaration(); | |
629 int hasPointers(); | |
630 | |
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 #if IN_DMD |
159 | 632 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
|
633 #endif |
159 | 634 }; |
635 | |
636 struct TypeTypedef : Type | |
637 { | |
638 TypedefDeclaration *sym; | |
639 | |
640 TypeTypedef(TypedefDeclaration *sym); | |
641 Type *syntaxCopy(); | |
642 d_uns64 size(Loc loc); | |
643 unsigned alignsize(); | |
644 char *toChars(); | |
645 Type *semantic(Loc loc, Scope *sc); | |
646 Dsymbol *toDsymbol(Scope *sc); | |
1228
79758fd2f48a
Added Doxygen file.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1192
diff
changeset
|
647 void toDecoBuffer(OutBuffer *buf, bool mangle); |
159 | 648 void toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod); |
649 Expression *dotExp(Scope *sc, Expression *e, Identifier *ident); | |
650 Expression *getProperty(Loc loc, Identifier *ident); | |
651 int isbit(); | |
652 int isintegral(); | |
653 int isfloating(); | |
654 int isreal(); | |
655 int isimaginary(); | |
656 int iscomplex(); | |
657 int isscalar(); | |
658 int isunsigned(); | |
659 int checkBoolean(); | |
660 Type *toBasetype(); | |
661 MATCH implicitConvTo(Type *to); | |
662 Expression *defaultInit(Loc loc); | |
1367
8026319762be
Merged DMD 1.045 !!!
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents:
1364
diff
changeset
|
663 int isZeroInit(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
|
664 #if IN_DMD |
159 | 665 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
|
666 #endif |
159 | 667 MATCH deduceType(Scope *sc, Type *tparam, TemplateParameters *parameters, Objects *dedtypes); |
668 TypeInfoDeclaration *getTypeInfoDeclaration(); | |
669 int hasPointers(); | |
670 | |
1146
1860414bf3b7
* Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1103
diff
changeset
|
671 #if IN_DMD |
159 | 672 type *toCtype(); |
673 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
|
674 #endif |
159 | 675 }; |
676 | |
677 struct TypeClass : Type | |
678 { | |
679 ClassDeclaration *sym; | |
680 | |
681 TypeClass(ClassDeclaration *sym); | |
682 d_uns64 size(Loc loc); | |
683 char *toChars(); | |
684 Type *syntaxCopy(); | |
685 Type *semantic(Loc loc, Scope *sc); | |
686 Dsymbol *toDsymbol(Scope *sc); | |
1228
79758fd2f48a
Added Doxygen file.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1192
diff
changeset
|
687 void toDecoBuffer(OutBuffer *buf, bool mangle); |
159 | 688 void toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod); |
689 Expression *dotExp(Scope *sc, Expression *e, Identifier *ident); | |
690 ClassDeclaration *isClassHandle(); | |
691 int isBaseOf(Type *t, int *poffset); | |
692 MATCH implicitConvTo(Type *to); | |
693 Expression *defaultInit(Loc loc); | |
1367
8026319762be
Merged DMD 1.045 !!!
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents:
1364
diff
changeset
|
694 int isZeroInit(Loc loc); |
159 | 695 MATCH deduceType(Scope *sc, Type *tparam, TemplateParameters *parameters, Objects *dedtypes); |
1530
05c235309d6f
Make the auto storage class never have the same meaning as scope.
Christian Kamm <kamm incasoftware de>
parents:
1372
diff
changeset
|
696 int isscope(); |
159 | 697 int checkBoolean(); |
698 TypeInfoDeclaration *getTypeInfoDeclaration(); | |
699 int hasPointers(); | |
1367
8026319762be
Merged DMD 1.045 !!!
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents:
1364
diff
changeset
|
700 int builtinTypeInfo(); |
8026319762be
Merged DMD 1.045 !!!
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents:
1364
diff
changeset
|
701 #if DMDV2 |
8026319762be
Merged DMD 1.045 !!!
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents:
1364
diff
changeset
|
702 Type *toHeadMutable(); |
8026319762be
Merged DMD 1.045 !!!
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents:
1364
diff
changeset
|
703 MATCH constConv(Type *to); |
8026319762be
Merged DMD 1.045 !!!
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents:
1364
diff
changeset
|
704 #if TARGET_LINUX || TARGET_OSX |
8026319762be
Merged DMD 1.045 !!!
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents:
1364
diff
changeset
|
705 void toCppMangle(OutBuffer *buf, CppMangleState *cms); |
8026319762be
Merged DMD 1.045 !!!
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents:
1364
diff
changeset
|
706 #endif |
8026319762be
Merged DMD 1.045 !!!
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents:
1364
diff
changeset
|
707 #endif |
159 | 708 |
1146
1860414bf3b7
* Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1103
diff
changeset
|
709 #if IN_DMD |
159 | 710 type *toCtype(); |
711 | |
712 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
|
713 #endif |
159 | 714 }; |
715 | |
716 struct TypeTuple : Type | |
717 { | |
718 Arguments *arguments; // types making up the tuple | |
719 | |
720 TypeTuple(Arguments *arguments); | |
721 TypeTuple(Expressions *exps); | |
722 Type *syntaxCopy(); | |
723 Type *semantic(Loc loc, Scope *sc); | |
724 int equals(Object *o); | |
725 Type *reliesOnTident(); | |
726 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
|
727 void toDecoBuffer(OutBuffer *buf, bool mangle); |
159 | 728 Expression *getProperty(Loc loc, Identifier *ident); |
729 TypeInfoDeclaration *getTypeInfoDeclaration(); | |
730 }; | |
731 | |
732 struct TypeSlice : Type | |
733 { | |
734 Expression *lwr; | |
735 Expression *upr; | |
736 | |
737 TypeSlice(Type *next, Expression *lwr, Expression *upr); | |
738 Type *syntaxCopy(); | |
739 Type *semantic(Loc loc, Scope *sc); | |
740 void resolve(Loc loc, Scope *sc, Expression **pe, Type **pt, Dsymbol **ps); | |
741 void toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod); | |
742 }; | |
743 | |
744 /**************************************************************/ | |
745 | |
746 //enum InOut { None, In, Out, InOut, Lazy }; | |
747 | |
748 struct Argument : Object | |
749 { | |
750 //enum InOut inout; | |
751 unsigned storageClass; | |
752 Type *type; | |
753 Identifier *ident; | |
754 Expression *defaultArg; | |
755 | |
756 Argument(unsigned storageClass, Type *type, Identifier *ident, Expression *defaultArg); | |
757 Argument *syntaxCopy(); | |
758 Type *isLazyArray(); | |
1228
79758fd2f48a
Added Doxygen file.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1192
diff
changeset
|
759 void toDecoBuffer(OutBuffer *buf, bool mangle); |
159 | 760 static Arguments *arraySyntaxCopy(Arguments *args); |
761 static char *argsTypesToChars(Arguments *args, int varargs); | |
762 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
|
763 static void argsToDecoBuffer(OutBuffer *buf, Arguments *arguments, bool mangle); |
159 | 764 static size_t dim(Arguments *arguments); |
765 static Argument *getNth(Arguments *arguments, size_t nth, size_t *pn = NULL); | |
766 }; | |
767 | |
768 extern int PTRSIZE; | |
769 extern int REALSIZE; | |
770 extern int REALPAD; | |
771 extern int Tsize_t; | |
772 extern int Tptrdiff_t; | |
773 | |
774 #endif /* DMD_MTYPE_H */ |