Mercurial > projects > ldc
annotate dmd/mtype.h @ 1404:11b122f92136
Now that templates instantiations are no longer emitted for all modules that
even blink at them they seem to break due to being linkonce (if compiled with
any optimization level > 0), so let's give them weak linkage instead.
The difference is that unreferenced linkonce symbols can be deleted, while
weak symbols need to be preserved.
author | Frits van Bommel <fvbommel wxs.nl> |
---|---|
date | Thu, 21 May 2009 15:23:28 +0200 |
parents | 229e02867307 |
children | 05c235309d6f |
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(); | |
237 virtual int isauto(); | |
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); | |
564 Type *semantic(Loc loc, Scope *sc); | |
565 d_uns64 size(Loc loc); | |
566 }; | |
567 | |
568 struct TypeStruct : Type | |
569 { | |
570 StructDeclaration *sym; | |
571 | |
572 TypeStruct(StructDeclaration *sym); | |
573 d_uns64 size(Loc loc); | |
574 unsigned alignsize(); | |
575 char *toChars(); | |
576 Type *syntaxCopy(); | |
577 Type *semantic(Loc loc, Scope *sc); | |
578 Dsymbol *toDsymbol(Scope *sc); | |
1228
79758fd2f48a
Added Doxygen file.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1192
diff
changeset
|
579 void toDecoBuffer(OutBuffer *buf, bool mangle); |
159 | 580 void toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod); |
581 Expression *dotExp(Scope *sc, Expression *e, Identifier *ident); | |
582 unsigned memalign(unsigned salign); | |
583 Expression *defaultInit(Loc loc); | |
1367
8026319762be
Merged DMD 1.045 !!!
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents:
1364
diff
changeset
|
584 int isZeroInit(Loc loc); |
159 | 585 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
|
586 #if IN_DMD |
159 | 587 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
|
588 #endif |
159 | 589 MATCH deduceType(Scope *sc, Type *tparam, TemplateParameters *parameters, Objects *dedtypes); |
590 TypeInfoDeclaration *getTypeInfoDeclaration(); | |
591 int hasPointers(); | |
592 | |
1146
1860414bf3b7
* Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1103
diff
changeset
|
593 #if IN_DMD |
159 | 594 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
|
595 #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
|
596 // 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
|
597 // 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
|
598 // 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
|
599 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
|
600 #endif |
159 | 601 }; |
602 | |
603 struct TypeEnum : Type | |
604 { | |
605 EnumDeclaration *sym; | |
606 | |
607 TypeEnum(EnumDeclaration *sym); | |
608 d_uns64 size(Loc loc); | |
609 unsigned alignsize(); | |
610 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
|
611 Type *syntaxCopy(); |
159 | 612 Type *semantic(Loc loc, Scope *sc); |
613 Dsymbol *toDsymbol(Scope *sc); | |
1228
79758fd2f48a
Added Doxygen file.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1192
diff
changeset
|
614 void toDecoBuffer(OutBuffer *buf, bool mangle); |
159 | 615 void toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod); |
616 Expression *dotExp(Scope *sc, Expression *e, Identifier *ident); | |
617 Expression *getProperty(Loc loc, Identifier *ident); | |
618 int isintegral(); | |
619 int isfloating(); | |
620 int isscalar(); | |
621 int isunsigned(); | |
622 MATCH implicitConvTo(Type *to); | |
623 Type *toBasetype(); | |
624 Expression *defaultInit(Loc loc); | |
1367
8026319762be
Merged DMD 1.045 !!!
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents:
1364
diff
changeset
|
625 int isZeroInit(Loc loc); |
159 | 626 MATCH deduceType(Scope *sc, Type *tparam, TemplateParameters *parameters, Objects *dedtypes); |
627 TypeInfoDeclaration *getTypeInfoDeclaration(); | |
628 int hasPointers(); | |
629 | |
1146
1860414bf3b7
* Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1103
diff
changeset
|
630 #if IN_DMD |
159 | 631 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
|
632 #endif |
159 | 633 }; |
634 | |
635 struct TypeTypedef : Type | |
636 { | |
637 TypedefDeclaration *sym; | |
638 | |
639 TypeTypedef(TypedefDeclaration *sym); | |
640 Type *syntaxCopy(); | |
641 d_uns64 size(Loc loc); | |
642 unsigned alignsize(); | |
643 char *toChars(); | |
644 Type *semantic(Loc loc, Scope *sc); | |
645 Dsymbol *toDsymbol(Scope *sc); | |
1228
79758fd2f48a
Added Doxygen file.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1192
diff
changeset
|
646 void toDecoBuffer(OutBuffer *buf, bool mangle); |
159 | 647 void toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod); |
648 Expression *dotExp(Scope *sc, Expression *e, Identifier *ident); | |
649 Expression *getProperty(Loc loc, Identifier *ident); | |
650 int isbit(); | |
651 int isintegral(); | |
652 int isfloating(); | |
653 int isreal(); | |
654 int isimaginary(); | |
655 int iscomplex(); | |
656 int isscalar(); | |
657 int isunsigned(); | |
658 int checkBoolean(); | |
659 Type *toBasetype(); | |
660 MATCH implicitConvTo(Type *to); | |
661 Expression *defaultInit(Loc loc); | |
1367
8026319762be
Merged DMD 1.045 !!!
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents:
1364
diff
changeset
|
662 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
|
663 #if IN_DMD |
159 | 664 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
|
665 #endif |
159 | 666 MATCH deduceType(Scope *sc, Type *tparam, TemplateParameters *parameters, Objects *dedtypes); |
667 TypeInfoDeclaration *getTypeInfoDeclaration(); | |
668 int hasPointers(); | |
669 | |
1146
1860414bf3b7
* Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1103
diff
changeset
|
670 #if IN_DMD |
159 | 671 type *toCtype(); |
672 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
|
673 #endif |
159 | 674 }; |
675 | |
676 struct TypeClass : Type | |
677 { | |
678 ClassDeclaration *sym; | |
679 | |
680 TypeClass(ClassDeclaration *sym); | |
681 d_uns64 size(Loc loc); | |
682 char *toChars(); | |
683 Type *syntaxCopy(); | |
684 Type *semantic(Loc loc, Scope *sc); | |
685 Dsymbol *toDsymbol(Scope *sc); | |
1228
79758fd2f48a
Added Doxygen file.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1192
diff
changeset
|
686 void toDecoBuffer(OutBuffer *buf, bool mangle); |
159 | 687 void toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod); |
688 Expression *dotExp(Scope *sc, Expression *e, Identifier *ident); | |
689 ClassDeclaration *isClassHandle(); | |
690 int isBaseOf(Type *t, int *poffset); | |
691 MATCH implicitConvTo(Type *to); | |
692 Expression *defaultInit(Loc loc); | |
1367
8026319762be
Merged DMD 1.045 !!!
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents:
1364
diff
changeset
|
693 int isZeroInit(Loc loc); |
159 | 694 MATCH deduceType(Scope *sc, Type *tparam, TemplateParameters *parameters, Objects *dedtypes); |
695 int isauto(); | |
696 int checkBoolean(); | |
697 TypeInfoDeclaration *getTypeInfoDeclaration(); | |
698 int hasPointers(); | |
1367
8026319762be
Merged DMD 1.045 !!!
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents:
1364
diff
changeset
|
699 int builtinTypeInfo(); |
8026319762be
Merged DMD 1.045 !!!
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents:
1364
diff
changeset
|
700 #if DMDV2 |
8026319762be
Merged DMD 1.045 !!!
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents:
1364
diff
changeset
|
701 Type *toHeadMutable(); |
8026319762be
Merged DMD 1.045 !!!
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents:
1364
diff
changeset
|
702 MATCH constConv(Type *to); |
8026319762be
Merged DMD 1.045 !!!
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents:
1364
diff
changeset
|
703 #if TARGET_LINUX || TARGET_OSX |
8026319762be
Merged DMD 1.045 !!!
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents:
1364
diff
changeset
|
704 void toCppMangle(OutBuffer *buf, CppMangleState *cms); |
8026319762be
Merged DMD 1.045 !!!
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents:
1364
diff
changeset
|
705 #endif |
8026319762be
Merged DMD 1.045 !!!
Tomas Lindquist Olsen <tomas.l.olsen gmail com>
parents:
1364
diff
changeset
|
706 #endif |
159 | 707 |
1146
1860414bf3b7
* Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1103
diff
changeset
|
708 #if IN_DMD |
159 | 709 type *toCtype(); |
710 | |
711 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
|
712 #endif |
159 | 713 }; |
714 | |
715 struct TypeTuple : Type | |
716 { | |
717 Arguments *arguments; // types making up the tuple | |
718 | |
719 TypeTuple(Arguments *arguments); | |
720 TypeTuple(Expressions *exps); | |
721 Type *syntaxCopy(); | |
722 Type *semantic(Loc loc, Scope *sc); | |
723 int equals(Object *o); | |
724 Type *reliesOnTident(); | |
725 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
|
726 void toDecoBuffer(OutBuffer *buf, bool mangle); |
159 | 727 Expression *getProperty(Loc loc, Identifier *ident); |
728 TypeInfoDeclaration *getTypeInfoDeclaration(); | |
729 }; | |
730 | |
731 struct TypeSlice : Type | |
732 { | |
733 Expression *lwr; | |
734 Expression *upr; | |
735 | |
736 TypeSlice(Type *next, Expression *lwr, Expression *upr); | |
737 Type *syntaxCopy(); | |
738 Type *semantic(Loc loc, Scope *sc); | |
739 void resolve(Loc loc, Scope *sc, Expression **pe, Type **pt, Dsymbol **ps); | |
740 void toCBuffer2(OutBuffer *buf, HdrGenState *hgs, int mod); | |
741 }; | |
742 | |
743 /**************************************************************/ | |
744 | |
745 //enum InOut { None, In, Out, InOut, Lazy }; | |
746 | |
747 struct Argument : Object | |
748 { | |
749 //enum InOut inout; | |
750 unsigned storageClass; | |
751 Type *type; | |
752 Identifier *ident; | |
753 Expression *defaultArg; | |
754 | |
755 Argument(unsigned storageClass, Type *type, Identifier *ident, Expression *defaultArg); | |
756 Argument *syntaxCopy(); | |
757 Type *isLazyArray(); | |
1228
79758fd2f48a
Added Doxygen file.
Tomas Lindquist Olsen <tomas.l.olsen gmail.com>
parents:
1192
diff
changeset
|
758 void toDecoBuffer(OutBuffer *buf, bool mangle); |
159 | 759 static Arguments *arraySyntaxCopy(Arguments *args); |
760 static char *argsTypesToChars(Arguments *args, int varargs); | |
761 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
|
762 static void argsToDecoBuffer(OutBuffer *buf, Arguments *arguments, bool mangle); |
159 | 763 static size_t dim(Arguments *arguments); |
764 static Argument *getNth(Arguments *arguments, size_t nth, size_t *pn = NULL); | |
765 }; | |
766 | |
767 extern int PTRSIZE; | |
768 extern int REALSIZE; | |
769 extern int REALPAD; | |
770 extern int Tsize_t; | |
771 extern int Tptrdiff_t; | |
772 | |
773 #endif /* DMD_MTYPE_H */ |