Mercurial > projects > ddmd
annotate dmd/TypeAArray.d @ 114:e28b18c23469
added a module dmd.common for commonly used stuff
it currently holds code for consistency checking of predefined versions
also added a VisualD project file
author | Trass3r |
---|---|
date | Wed, 01 Sep 2010 18:21:58 +0200 |
parents | 2f57c5ecd3b2 |
children | 010eb8f0e18d |
rev | line source |
---|---|
0 | 1 module dmd.TypeAArray; |
2 | |
114 | 3 import dmd.common; |
0 | 4 import dmd.TypeArray; |
5 import dmd.MOD; | |
6 import dmd.ArrayTypes; | |
7 import dmd.TypeInfoDeclaration; | |
68
ee3a9f34dc48
final bits of codegen implementation to compile Phobos
korDen
parents:
67
diff
changeset
|
8 import dmd.TypeInfoAssociativeArrayDeclaration; |
0 | 9 import dmd.Expression; |
10 import dmd.Scope; | |
96 | 11 import dmd.StructDeclaration; |
0 | 12 import dmd.Loc; |
67 | 13 import dmd.Global; |
0 | 14 import dmd.Dsymbol; |
15 import dmd.Type; | |
16 import dmd.TypeSArray; | |
17 import dmd.OutBuffer; | |
18 import dmd.HdrGenState; | |
19 import dmd.Identifier; | |
20 import dmd.MATCH; | |
21 import dmd.TY; | |
96 | 22 import dmd.TemplateInstance; |
0 | 23 import dmd.Id; |
24 import dmd.CallExp; | |
25 import dmd.IntegerExp; | |
26 import dmd.FuncDeclaration; | |
27 import dmd.VarExp; | |
28 import dmd.TypeFunction; | |
29 import dmd.NullExp; | |
30 import dmd.Array; | |
31 | |
32 import dmd.backend.Symbol; | |
33 import dmd.backend.TYPE; | |
34 import dmd.backend.Util; | |
35 import dmd.backend.SC; | |
36 import dmd.backend.LIST; | |
37 import dmd.backend.TYM; | |
38 import dmd.backend.TF; | |
67 | 39 import dmd.backend.Classsym; |
0 | 40 import dmd.backend.mTYman; |
41 | |
42 import core.stdc.stdio; | |
43 import core.stdc.stdlib; | |
14
2cc604139636
Implemented Linux support for ddmd. Some parts are a bit hacky to just "get it working", that said, druntime and phobos compile, and unittests pass.
Robert Clipsham <robert@octarineparrot.com>
parents:
0
diff
changeset
|
44 version (Bug4054) |
2cc604139636
Implemented Linux support for ddmd. Some parts are a bit hacky to just "get it working", that said, druntime and phobos compile, and unittests pass.
Robert Clipsham <robert@octarineparrot.com>
parents:
0
diff
changeset
|
45 import core.memory; |
0 | 46 class TypeAArray : TypeArray |
47 { | |
96 | 48 Type index; // key type |
49 Loc loc; | |
50 Scope sc; | |
51 StructDeclaration impl; // implementation | |
0 | 52 |
53 this(Type t, Type index) | |
54 { | |
55 super(Taarray, t); | |
56 this.index = index; | |
57 } | |
58 | |
72 | 59 override Type syntaxCopy() |
0 | 60 { |
51 | 61 Type t = next.syntaxCopy(); |
62 Type ti = index.syntaxCopy(); | |
63 if (t == next && ti == index) | |
64 t = this; | |
65 else | |
66 { | |
67 t = new TypeAArray(t, ti); | |
68 t.mod = mod; | |
69 } | |
70 return t; | |
0 | 71 } |
72 | |
73 version (DumbClone) { | |
74 } else { | |
75 Type clone() | |
76 { | |
77 assert(false); | |
78 } | |
79 } | |
72 | 80 override ulong size(Loc loc) |
0 | 81 { |
82 return PTRSIZE /* * 2*/; | |
83 } | |
84 | |
72 | 85 override Type semantic(Loc loc, Scope sc) |
0 | 86 { |
87 //printf("TypeAArray::semantic() %s index.ty = %d\n", toChars(), index.ty); | |
96 | 88 this.loc = loc; |
89 this.sc = sc; | |
90 if (sc) | |
91 sc.setNoFree(); | |
92 | |
0 | 93 // Deal with the case where we thought the index was a type, but |
94 // in reality it was an expression. | |
95 if (index.ty == Tident || index.ty == Tinstance || index.ty == Tsarray) | |
96 { | |
97 Expression e; | |
98 Type t; | |
99 Dsymbol s; | |
100 | |
101 index.resolve(loc, sc, &e, &t, &s); | |
102 if (e) | |
103 { // It was an expression - | |
104 // Rewrite as a static array | |
105 TypeSArray tsa = new TypeSArray(next, e); | |
106 return tsa.semantic(loc,sc); | |
107 } | |
108 else if (t) | |
109 index = t; | |
110 else | |
96 | 111 { |
0 | 112 index.error(loc, "index is not a type or an expression"); |
96 | 113 return Type.terror; |
114 } | |
0 | 115 } |
116 else | |
117 index = index.semantic(loc,sc); | |
118 | |
119 if (index.nextOf() && !index.nextOf().isInvariant()) | |
120 { | |
121 index = index.constOf().mutableOf(); | |
96 | 122 static if (false) |
123 { | |
0 | 124 printf("index is %p %s\n", index, index.toChars()); |
125 index.check(); | |
126 printf("index.mod = x%x\n", index.mod); | |
127 printf("index.ito = x%x\n", index.ito); | |
128 if (index.ito) { | |
129 printf("index.ito.mod = x%x\n", index.ito.mod); | |
130 printf("index.ito.ito = x%x\n", index.ito.ito); | |
131 } | |
132 } | |
133 } | |
134 | |
135 switch (index.toBasetype().ty) | |
136 { | |
137 case Tbool: | |
138 case Tfunction: | |
139 case Tvoid: | |
140 case Tnone: | |
73 | 141 case Ttuple: |
0 | 142 error(loc, "can't have associative array key of %s", index.toBasetype().toChars()); |
96 | 143 return Type.terror; |
0 | 144 default: |
145 break; /// | |
146 } | |
147 next = next.semantic(loc,sc); | |
148 transitive(); | |
149 | |
150 switch (next.toBasetype().ty) | |
151 { | |
152 case Tfunction: | |
153 case Tnone: | |
154 error(loc, "can't have associative array of %s", next.toChars()); | |
96 | 155 return Type.terror; |
0 | 156 default: |
157 break; /// | |
158 } | |
159 if (next.isauto()) | |
96 | 160 { |
0 | 161 error(loc, "cannot have array of auto %s", next.toChars()); |
96 | 162 return Type.terror; |
163 } | |
0 | 164 return merge(); |
165 } | |
166 | |
96 | 167 StructDeclaration getImpl() |
168 { | |
169 // Do it lazily | |
170 if (!impl) | |
171 { | |
172 if (!index.reliesOnTident() && !next.reliesOnTident()) | |
173 { | |
174 /* This is really a proxy for the template instance AssocArray!(index, next) | |
175 * But the instantiation can fail if it is a template specialization field | |
176 * which has Tident's instead of real types. | |
177 */ | |
178 TemplateInstance ti = new TemplateInstance(loc, Id.AssociativeArray); | |
179 Objects tiargs = new Objects(); | |
111 | 180 tiargs.push(index); |
181 tiargs.push(next); | |
96 | 182 ti.tiargs = tiargs; |
183 | |
184 ti.semantic(sc); | |
185 ti.semantic2(sc); | |
186 ti.semantic3(sc); | |
187 impl = ti.toAlias().isStructDeclaration(); | |
188 debug | |
189 { | |
190 if (!impl) | |
191 { | |
192 Dsymbol s = ti.toAlias(); | |
193 writef("%s %s\n", s.kind(), s.toChars()); | |
194 } | |
195 } | |
196 assert(impl); | |
197 } | |
198 } | |
199 return impl; | |
200 | |
201 } | |
202 | |
72 | 203 override void resolve(Loc loc, Scope sc, Expression* pe, Type* pt, Dsymbol* ps) |
0 | 204 { |
51 | 205 //printf("TypeAArray.resolve() %s\n", toChars()); |
206 | |
207 // Deal with the case where we thought the index was a type, but | |
208 // in reality it was an expression. | |
209 if (index.ty == Tident || index.ty == Tinstance || index.ty == Tsarray) | |
210 { | |
211 Expression e; | |
212 Type t; | |
213 Dsymbol s; | |
214 | |
215 index.resolve(loc, sc, &e, &t, &s); | |
216 if (e) | |
217 { // It was an expression - | |
218 // Rewrite as a static array | |
219 | |
220 TypeSArray tsa = new TypeSArray(next, e); | |
221 return tsa.resolve(loc, sc, pe, pt, ps); | |
222 } | |
223 else if (t) | |
224 index = t; | |
225 else | |
226 index.error(loc, "index is not a type or an expression"); | |
227 } | |
228 Type.resolve(loc, sc, pe, pt, ps); | |
0 | 229 } |
230 | |
72 | 231 override void toDecoBuffer(OutBuffer buf, int flag) |
0 | 232 { |
233 Type.toDecoBuffer(buf, flag); | |
234 index.toDecoBuffer(buf); | |
235 next.toDecoBuffer(buf, (flag & 0x100) ? MOD.MODundefined : mod); | |
236 } | |
237 | |
72 | 238 override void toCBuffer2(OutBuffer buf, HdrGenState* hgs, MOD mod) |
0 | 239 { |
68
ee3a9f34dc48
final bits of codegen implementation to compile Phobos
korDen
parents:
67
diff
changeset
|
240 if (mod != this.mod) |
ee3a9f34dc48
final bits of codegen implementation to compile Phobos
korDen
parents:
67
diff
changeset
|
241 { |
ee3a9f34dc48
final bits of codegen implementation to compile Phobos
korDen
parents:
67
diff
changeset
|
242 toCBuffer3(buf, hgs, mod); |
ee3a9f34dc48
final bits of codegen implementation to compile Phobos
korDen
parents:
67
diff
changeset
|
243 return; |
ee3a9f34dc48
final bits of codegen implementation to compile Phobos
korDen
parents:
67
diff
changeset
|
244 } |
ee3a9f34dc48
final bits of codegen implementation to compile Phobos
korDen
parents:
67
diff
changeset
|
245 next.toCBuffer2(buf, hgs, this.mod); |
ee3a9f34dc48
final bits of codegen implementation to compile Phobos
korDen
parents:
67
diff
changeset
|
246 buf.writeByte('['); |
ee3a9f34dc48
final bits of codegen implementation to compile Phobos
korDen
parents:
67
diff
changeset
|
247 index.toCBuffer2(buf, hgs, MODundefined); |
ee3a9f34dc48
final bits of codegen implementation to compile Phobos
korDen
parents:
67
diff
changeset
|
248 buf.writeByte(']'); |
0 | 249 } |
250 | |
72 | 251 override Expression dotExp(Scope sc, Expression e, Identifier ident) |
0 | 252 { |
253 version (LOGDOTEXP) { | |
254 printf("TypeAArray.dotExp(e = '%s', ident = '%s')\n", e.toChars(), ident.toChars()); | |
255 } | |
96 | 256 static if (false) |
257 { | |
0 | 258 if (ident == Id.length) |
259 { | |
260 Expression ec; | |
261 FuncDeclaration fd; | |
262 Expressions arguments; | |
263 | |
264 fd = FuncDeclaration.genCfunc(Type.tsize_t, Id.aaLen); | |
265 ec = new VarExp(Loc(0), fd); | |
266 arguments = new Expressions(); | |
84
be2ab491772e
Expressions -> Vector!Expression
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
73
diff
changeset
|
267 arguments.push(e); |
0 | 268 e = new CallExp(e.loc, ec, arguments); |
269 e.type = (cast(TypeFunction)fd.type).next; | |
270 } | |
271 else if (ident == Id.keys) | |
272 { | |
273 Expression ec; | |
274 FuncDeclaration fd; | |
275 Expressions arguments; | |
276 int size = cast(int)index.size(e.loc); | |
277 | |
278 assert(size); | |
279 fd = FuncDeclaration.genCfunc(Type.tindex, Id.aaKeys); | |
280 ec = new VarExp(Loc(0), fd); | |
281 arguments = new Expressions(); | |
84
be2ab491772e
Expressions -> Vector!Expression
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
73
diff
changeset
|
282 arguments.push(e); |
be2ab491772e
Expressions -> Vector!Expression
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
73
diff
changeset
|
283 arguments.push(new IntegerExp(Loc(0), size, Type.tsize_t)); |
0 | 284 e = new CallExp(e.loc, ec, arguments); |
285 e.type = index.arrayOf(); | |
286 } | |
287 else if (ident == Id.values) | |
288 { | |
289 Expression ec; | |
290 FuncDeclaration fd; | |
291 Expressions arguments; | |
292 | |
293 fd = FuncDeclaration.genCfunc(Type.tindex, Id.aaValues); | |
294 ec = new VarExp(Loc(0), fd); | |
295 arguments = new Expressions(); | |
84
be2ab491772e
Expressions -> Vector!Expression
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
73
diff
changeset
|
296 arguments.push(e); |
0 | 297 size_t keysize = cast(size_t)index.size(e.loc); |
298 keysize = (keysize + PTRSIZE - 1) & ~(PTRSIZE - 1); | |
84
be2ab491772e
Expressions -> Vector!Expression
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
73
diff
changeset
|
299 arguments.push(new IntegerExp(Loc(0), keysize, Type.tsize_t)); |
be2ab491772e
Expressions -> Vector!Expression
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
73
diff
changeset
|
300 arguments.push(new IntegerExp(Loc(0), next.size(e.loc), Type.tsize_t)); |
0 | 301 e = new CallExp(e.loc, ec, arguments); |
302 e.type = next.arrayOf(); | |
303 } | |
304 else if (ident == Id.rehash) | |
305 { | |
306 Expression ec; | |
307 FuncDeclaration fd; | |
308 Expressions arguments; | |
309 | |
310 fd = FuncDeclaration.genCfunc(Type.tint64, Id.aaRehash); | |
311 ec = new VarExp(Loc(0), fd); | |
312 arguments = new Expressions(); | |
84
be2ab491772e
Expressions -> Vector!Expression
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
73
diff
changeset
|
313 arguments.push(e.addressOf(sc)); |
be2ab491772e
Expressions -> Vector!Expression
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
73
diff
changeset
|
314 arguments.push(index.getInternalTypeInfo(sc)); |
0 | 315 e = new CallExp(e.loc, ec, arguments); |
316 e.type = this; | |
317 } | |
96 | 318 // else |
319 } // of static if (false) | |
0 | 320 { |
96 | 321 e.type = getImpl().type; |
322 e = e.type.dotExp(sc, e, ident); | |
323 //e = Type.dotExp(sc, e, ident); | |
0 | 324 } |
325 return e; | |
326 } | |
327 | |
72 | 328 override Expression defaultInit(Loc loc) |
0 | 329 { |
330 version (LOGDEFAULTINIT) { | |
331 printf("TypeAArray.defaultInit() '%s'\n", toChars()); | |
332 } | |
333 Expression e = new NullExp(loc); | |
334 e.type = this; | |
335 return e; | |
336 } | |
337 | |
72 | 338 override MATCH deduceType(Scope sc, Type tparam, TemplateParameters parameters, Objects dedtypes) |
0 | 339 { |
51 | 340 static if (false) { |
341 printf("TypeAArray.deduceType()\n"); | |
342 printf("\tthis = %d, ", ty); print(); | |
343 printf("\ttparam = %d, ", tparam.ty); tparam.print(); | |
344 } | |
345 | |
346 // Extra check that index type must match | |
347 if (tparam && tparam.ty == Taarray) | |
348 { | |
349 TypeAArray tp = cast(TypeAArray)tparam; | |
350 if (!index.deduceType(sc, tp.index, parameters, dedtypes)) | |
351 { | |
352 return MATCHnomatch; | |
353 } | |
354 } | |
355 return Type.deduceType(sc, tparam, parameters, dedtypes); | |
0 | 356 } |
357 | |
72 | 358 override bool isZeroInit(Loc loc) |
0 | 359 { |
360 assert(false); | |
361 } | |
362 | |
72 | 363 override bool checkBoolean() |
0 | 364 { |
365 assert(false); | |
366 } | |
367 | |
72 | 368 override TypeInfoDeclaration getTypeInfoDeclaration() |
0 | 369 { |
68
ee3a9f34dc48
final bits of codegen implementation to compile Phobos
korDen
parents:
67
diff
changeset
|
370 return new TypeInfoAssociativeArrayDeclaration(this); |
0 | 371 } |
372 | |
72 | 373 override bool hasPointers() |
0 | 374 { |
375 return true; | |
376 } | |
377 | |
72 | 378 override MATCH implicitConvTo(Type to) |
0 | 379 { |
51 | 380 //printf("TypeAArray.implicitConvTo(to = %s) this = %s\n", to.toChars(), toChars()); |
381 if (equals(to)) | |
382 return MATCHexact; | |
383 | |
384 if (to.ty == Taarray) | |
385 { | |
386 TypeAArray ta = cast(TypeAArray)to; | |
387 | |
388 if (!(next.mod == ta.next.mod || ta.next.mod == MODconst)) | |
389 return MATCHnomatch; // not const-compatible | |
390 | |
391 if (!(index.mod == ta.index.mod || ta.index.mod == MODconst)) | |
392 return MATCHnomatch; // not const-compatible | |
393 | |
394 MATCH m = next.constConv(ta.next); | |
395 MATCH mi = index.constConv(ta.index); | |
396 if (m != MATCHnomatch && mi != MATCHnomatch) | |
397 { | |
398 if (m == MATCHexact && mod != to.mod) | |
399 m = MATCHconst; | |
400 if (mi < m) | |
401 m = mi; | |
402 return m; | |
403 } | |
404 } | |
405 return Type.implicitConvTo(to); | |
0 | 406 } |
407 | |
72 | 408 override MATCH constConv(Type to) |
0 | 409 { |
410 assert(false); | |
411 } | |
412 | |
413 version (CPP_MANGLE) { | |
414 void toCppMangle(OutBuffer buf, CppMangleState* cms) | |
415 { | |
416 assert(false); | |
417 } | |
418 } | |
419 | |
420 // Back end | |
421 /******************************************** | |
422 * Determine the right symbol to look up | |
423 * an associative array element. | |
424 * Input: | |
425 * flags 0 don't add value signature | |
426 * 1 add value signature | |
427 */ | |
428 Symbol* aaGetSymbol(const(char)* func, int flags) | |
429 in | |
430 { | |
431 assert(func); | |
432 assert((flags & ~1) == 0); | |
433 } | |
434 out (result) | |
435 { | |
436 assert(result); | |
437 } | |
438 body | |
439 { | |
440 int sz; | |
441 char* id; | |
442 type* t; | |
443 Symbol* s; | |
444 int i; | |
445 | |
446 // Dumb linear symbol table - should use associative array! | |
447 static Array sarray = null; | |
448 | |
449 //printf("aaGetSymbol(func = '%s', flags = %d, key = %p)\n", func, flags, key); | |
450 static if (false) { | |
451 scope OutBuffer buf = new OutBuffer(); | |
452 key.toKeyBuffer(buf); | |
453 | |
454 sz = next.size(); // it's just data, so we only care about the size | |
455 sz = (sz + 3) & ~3; // reduce proliferation of library routines | |
14
2cc604139636
Implemented Linux support for ddmd. Some parts are a bit hacky to just "get it working", that said, druntime and phobos compile, and unittests pass.
Robert Clipsham <robert@octarineparrot.com>
parents:
0
diff
changeset
|
456 version (Bug4054) |
2cc604139636
Implemented Linux support for ddmd. Some parts are a bit hacky to just "get it working", that said, druntime and phobos compile, and unittests pass.
Robert Clipsham <robert@octarineparrot.com>
parents:
0
diff
changeset
|
457 id = cast(char*)GC.malloc(3 + strlen(func) + buf.offset + sizeof(sz) * 3 + 1); |
2cc604139636
Implemented Linux support for ddmd. Some parts are a bit hacky to just "get it working", that said, druntime and phobos compile, and unittests pass.
Robert Clipsham <robert@octarineparrot.com>
parents:
0
diff
changeset
|
458 else |
0 | 459 id = cast(char*)alloca(3 + strlen(func) + buf.offset + sizeof(sz) * 3 + 1); |
460 buf.writeByte(0); | |
461 if (flags & 1) | |
462 sprintf(id, "_aa%s%s%d", func, buf.data, sz); | |
463 else | |
464 sprintf(id, "_aa%s%s", func, buf.data); | |
465 } else { | |
14
2cc604139636
Implemented Linux support for ddmd. Some parts are a bit hacky to just "get it working", that said, druntime and phobos compile, and unittests pass.
Robert Clipsham <robert@octarineparrot.com>
parents:
0
diff
changeset
|
466 version (Bug4054) |
2cc604139636
Implemented Linux support for ddmd. Some parts are a bit hacky to just "get it working", that said, druntime and phobos compile, and unittests pass.
Robert Clipsham <robert@octarineparrot.com>
parents:
0
diff
changeset
|
467 id = cast(char*)GC.malloc(3 + strlen(func) + 1); |
2cc604139636
Implemented Linux support for ddmd. Some parts are a bit hacky to just "get it working", that said, druntime and phobos compile, and unittests pass.
Robert Clipsham <robert@octarineparrot.com>
parents:
0
diff
changeset
|
468 else |
0 | 469 id = cast(char*)alloca(3 + strlen(func) + 1); |
470 sprintf(id, "_aa%s", func); | |
471 } | |
472 if (!sarray) | |
473 sarray = new Array(); | |
474 | |
475 // See if symbol is already in sarray | |
476 for (i = 0; i < sarray.dim; i++) | |
477 { | |
478 s = cast(Symbol*)sarray.data[i]; | |
479 if (strcmp(id, s.Sident.ptr) == 0) | |
480 return s; // use existing Symbol | |
481 } | |
482 | |
483 // Create new Symbol | |
484 | |
485 s = symbol_calloc(id); | |
486 slist_add(s); | |
487 s.Sclass = SCextern; | |
488 s.Ssymnum = -1; | |
489 symbol_func(s); | |
490 | |
491 t = type_alloc(TYnfunc); | |
492 t.Tflags = TFprototype | TFfixed; | |
493 t.Tmangle = mTYman_c; | |
494 t.Tparamtypes = null; | |
495 t.Tnext = next.toCtype(); | |
496 t.Tnext.Tcount++; | |
497 t.Tcount++; | |
498 s.Stype = t; | |
499 | |
500 sarray.push(s); // remember it | |
501 return s; | |
502 } | |
503 | |
72 | 504 override type* toCtype() |
0 | 505 { |
67 | 506 type* t; |
507 | |
508 if (ctype) | |
509 return ctype; | |
510 | |
511 if (0 && global.params.symdebug) | |
512 { | |
513 /* An associative array is represented by: | |
514 * struct AArray { size_t length; void* ptr; } | |
515 */ | |
516 | |
517 static Symbol* s; | |
518 | |
519 if (!s) | |
520 { | |
521 s = symbol_calloc("_AArray"); | |
522 s.Sclass = SCstruct; | |
523 s.Sstruct = struct_calloc(); | |
524 s.Sstruct.Sflags |= 0; | |
525 s.Sstruct.Salignsize = alignsize(); | |
526 s.Sstruct.Sstructalign = cast(ubyte)global.structalign; | |
527 s.Sstruct.Sstructsize = cast(uint)size(Loc(0)); | |
528 slist_add(s); | |
529 | |
530 Symbol* s1 = symbol_name("length", SCmember, Type.tsize_t.toCtype()); | |
531 list_append(&s.Sstruct.Sfldlst, s1); | |
532 | |
533 Symbol* s2 = symbol_name("data", SCmember, Type.tvoidptr.toCtype()); | |
534 s2.Smemoff = cast(uint)Type.tsize_t.size(); | |
535 list_append(&s.Sstruct.Sfldlst, s2); | |
536 } | |
537 | |
538 t = type_alloc(TYstruct); | |
539 t.Ttag = cast(Classsym*)s; // structure tag name | |
540 t.Tcount++; | |
541 s.Stype = t; | |
542 } | |
543 else | |
544 { | |
545 if (global.params.symdebug == 1) | |
546 { | |
547 /* Generate D symbolic debug info, rather than C | |
548 * Tnext: element type | |
549 * Tkey: key type | |
550 */ | |
551 t = type_allocn(TYaarray, next.toCtype()); | |
552 t.Tkey = index.toCtype(); | |
553 t.Tkey.Tcount++; | |
554 } | |
555 else | |
556 t = type_fake(TYaarray); | |
557 } | |
558 t.Tcount++; | |
559 ctype = t; | |
560 return t; | |
0 | 561 } |
14
2cc604139636
Implemented Linux support for ddmd. Some parts are a bit hacky to just "get it working", that said, druntime and phobos compile, and unittests pass.
Robert Clipsham <robert@octarineparrot.com>
parents:
0
diff
changeset
|
562 } |