Mercurial > projects > ddmd
annotate dmd/TypeAArray.d @ 182:b64060ab22df
Now compileable with dmd2.050
author | korDen |
---|---|
date | Sat, 30 Oct 2010 05:05:32 +0400 |
parents | cd48cb899aee |
children | b0d41ff5e0df |
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; |
179 | 13 import dmd.DotTemplateInstanceExp; |
14 import dmd.IdentifierExp; | |
67 | 15 import dmd.Global; |
0 | 16 import dmd.Dsymbol; |
17 import dmd.Type; | |
18 import dmd.TypeSArray; | |
19 import dmd.OutBuffer; | |
20 import dmd.HdrGenState; | |
21 import dmd.Identifier; | |
22 import dmd.MATCH; | |
23 import dmd.TY; | |
96 | 24 import dmd.TemplateInstance; |
0 | 25 import dmd.Id; |
26 import dmd.CallExp; | |
27 import dmd.IntegerExp; | |
28 import dmd.FuncDeclaration; | |
29 import dmd.VarExp; | |
30 import dmd.TypeFunction; | |
31 import dmd.NullExp; | |
32 import dmd.Array; | |
33 | |
34 import dmd.backend.Symbol; | |
35 import dmd.backend.TYPE; | |
36 import dmd.backend.Util; | |
37 import dmd.backend.SC; | |
38 import dmd.backend.LIST; | |
39 import dmd.backend.TYM; | |
40 import dmd.backend.TF; | |
67 | 41 import dmd.backend.Classsym; |
0 | 42 import dmd.backend.mTYman; |
43 | |
44 import core.stdc.stdio; | |
45 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
|
46 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
|
47 import core.memory; |
0 | 48 class TypeAArray : TypeArray |
49 { | |
96 | 50 Type index; // key type |
51 Loc loc; | |
52 Scope sc; | |
53 StructDeclaration impl; // implementation | |
0 | 54 |
55 this(Type t, Type index) | |
56 { | |
178 | 57 register(); |
0 | 58 super(Taarray, t); |
59 this.index = index; | |
60 } | |
61 | |
72 | 62 override Type syntaxCopy() |
0 | 63 { |
51 | 64 Type t = next.syntaxCopy(); |
65 Type ti = index.syntaxCopy(); | |
66 if (t == next && ti == index) | |
67 t = this; | |
68 else | |
69 { | |
70 t = new TypeAArray(t, ti); | |
71 t.mod = mod; | |
72 } | |
73 return t; | |
0 | 74 } |
75 | |
72 | 76 override ulong size(Loc loc) |
0 | 77 { |
78 return PTRSIZE /* * 2*/; | |
79 } | |
80 | |
72 | 81 override Type semantic(Loc loc, Scope sc) |
0 | 82 { |
83 //printf("TypeAArray::semantic() %s index.ty = %d\n", toChars(), index.ty); | |
96 | 84 this.loc = loc; |
85 this.sc = sc; | |
86 if (sc) | |
87 sc.setNoFree(); | |
88 | |
0 | 89 // Deal with the case where we thought the index was a type, but |
90 // in reality it was an expression. | |
91 if (index.ty == Tident || index.ty == Tinstance || index.ty == Tsarray) | |
92 { | |
93 Expression e; | |
94 Type t; | |
95 Dsymbol s; | |
96 | |
97 index.resolve(loc, sc, &e, &t, &s); | |
98 if (e) | |
99 { // It was an expression - | |
100 // Rewrite as a static array | |
101 TypeSArray tsa = new TypeSArray(next, e); | |
102 return tsa.semantic(loc,sc); | |
103 } | |
104 else if (t) | |
105 index = t; | |
106 else | |
96 | 107 { |
0 | 108 index.error(loc, "index is not a type or an expression"); |
96 | 109 return Type.terror; |
110 } | |
0 | 111 } |
112 else | |
113 index = index.semantic(loc,sc); | |
114 | |
135 | 115 if (index.nextOf() && !index.nextOf().isImmutable()) |
0 | 116 { |
117 index = index.constOf().mutableOf(); | |
96 | 118 static if (false) |
119 { | |
0 | 120 printf("index is %p %s\n", index, index.toChars()); |
121 index.check(); | |
122 printf("index.mod = x%x\n", index.mod); | |
123 printf("index.ito = x%x\n", index.ito); | |
124 if (index.ito) { | |
125 printf("index.ito.mod = x%x\n", index.ito.mod); | |
126 printf("index.ito.ito = x%x\n", index.ito.ito); | |
127 } | |
128 } | |
129 } | |
130 | |
131 switch (index.toBasetype().ty) | |
132 { | |
133 case Tbool: | |
134 case Tfunction: | |
135 case Tvoid: | |
136 case Tnone: | |
73 | 137 case Ttuple: |
0 | 138 error(loc, "can't have associative array key of %s", index.toBasetype().toChars()); |
96 | 139 return Type.terror; |
0 | 140 default: |
141 break; /// | |
142 } | |
143 next = next.semantic(loc,sc); | |
144 transitive(); | |
145 | |
146 switch (next.toBasetype().ty) | |
147 { | |
148 case Tfunction: | |
149 case Tnone: | |
150 error(loc, "can't have associative array of %s", next.toChars()); | |
96 | 151 return Type.terror; |
0 | 152 default: |
153 break; /// | |
154 } | |
155 if (next.isauto()) | |
96 | 156 { |
0 | 157 error(loc, "cannot have array of auto %s", next.toChars()); |
96 | 158 return Type.terror; |
159 } | |
0 | 160 return merge(); |
161 } | |
162 | |
96 | 163 StructDeclaration getImpl() |
164 { | |
165 // Do it lazily | |
166 if (!impl) | |
167 { | |
168 if (!index.reliesOnTident() && !next.reliesOnTident()) | |
169 { | |
170 /* This is really a proxy for the template instance AssocArray!(index, next) | |
171 * But the instantiation can fail if it is a template specialization field | |
172 * which has Tident's instead of real types. | |
173 */ | |
174 Objects tiargs = new Objects(); | |
111 | 175 tiargs.push(index); |
176 tiargs.push(next); | |
179 | 177 |
178 // Create .AssociativeArray!(index, next) | |
179 DotTemplateInstanceExp dti = new DotTemplateInstanceExp(loc, | |
180 new IdentifierExp(loc, Id.empty), | |
181 Id.AssociativeArray, | |
182 tiargs); | |
183 dti.semantic(sc); | |
184 TemplateInstance ti = dti.ti; | |
185 | |
96 | 186 ti.semantic(sc); |
187 ti.semantic2(sc); | |
188 ti.semantic3(sc); | |
189 impl = ti.toAlias().isStructDeclaration(); | |
190 debug | |
191 { | |
192 if (!impl) | |
193 { | |
194 Dsymbol s = ti.toAlias(); | |
195 writef("%s %s\n", s.kind(), s.toChars()); | |
196 } | |
197 } | |
198 assert(impl); | |
199 } | |
200 } | |
201 return impl; | |
202 | |
203 } | |
204 | |
72 | 205 override void resolve(Loc loc, Scope sc, Expression* pe, Type* pt, Dsymbol* ps) |
0 | 206 { |
51 | 207 //printf("TypeAArray.resolve() %s\n", toChars()); |
208 | |
209 // Deal with the case where we thought the index was a type, but | |
210 // in reality it was an expression. | |
211 if (index.ty == Tident || index.ty == Tinstance || index.ty == Tsarray) | |
212 { | |
213 Expression e; | |
214 Type t; | |
215 Dsymbol s; | |
216 | |
217 index.resolve(loc, sc, &e, &t, &s); | |
218 if (e) | |
219 { // It was an expression - | |
220 // Rewrite as a static array | |
221 | |
222 TypeSArray tsa = new TypeSArray(next, e); | |
223 return tsa.resolve(loc, sc, pe, pt, ps); | |
224 } | |
225 else if (t) | |
226 index = t; | |
227 else | |
228 index.error(loc, "index is not a type or an expression"); | |
229 } | |
230 Type.resolve(loc, sc, pe, pt, ps); | |
0 | 231 } |
232 | |
72 | 233 override void toDecoBuffer(OutBuffer buf, int flag) |
0 | 234 { |
235 Type.toDecoBuffer(buf, flag); | |
236 index.toDecoBuffer(buf); | |
237 next.toDecoBuffer(buf, (flag & 0x100) ? MOD.MODundefined : mod); | |
238 } | |
239 | |
72 | 240 override void toCBuffer2(OutBuffer buf, HdrGenState* hgs, MOD mod) |
0 | 241 { |
68
ee3a9f34dc48
final bits of codegen implementation to compile Phobos
korDen
parents:
67
diff
changeset
|
242 if (mod != this.mod) |
ee3a9f34dc48
final bits of codegen implementation to compile Phobos
korDen
parents:
67
diff
changeset
|
243 { |
ee3a9f34dc48
final bits of codegen implementation to compile Phobos
korDen
parents:
67
diff
changeset
|
244 toCBuffer3(buf, hgs, mod); |
ee3a9f34dc48
final bits of codegen implementation to compile Phobos
korDen
parents:
67
diff
changeset
|
245 return; |
ee3a9f34dc48
final bits of codegen implementation to compile Phobos
korDen
parents:
67
diff
changeset
|
246 } |
ee3a9f34dc48
final bits of codegen implementation to compile Phobos
korDen
parents:
67
diff
changeset
|
247 next.toCBuffer2(buf, hgs, this.mod); |
ee3a9f34dc48
final bits of codegen implementation to compile Phobos
korDen
parents:
67
diff
changeset
|
248 buf.writeByte('['); |
ee3a9f34dc48
final bits of codegen implementation to compile Phobos
korDen
parents:
67
diff
changeset
|
249 index.toCBuffer2(buf, hgs, MODundefined); |
ee3a9f34dc48
final bits of codegen implementation to compile Phobos
korDen
parents:
67
diff
changeset
|
250 buf.writeByte(']'); |
0 | 251 } |
252 | |
72 | 253 override Expression dotExp(Scope sc, Expression e, Identifier ident) |
0 | 254 { |
255 version (LOGDOTEXP) { | |
256 printf("TypeAArray.dotExp(e = '%s', ident = '%s')\n", e.toChars(), ident.toChars()); | |
257 } | |
96 | 258 static if (false) |
259 { | |
0 | 260 if (ident == Id.length) |
261 { | |
262 Expression ec; | |
263 FuncDeclaration fd; | |
264 Expressions arguments; | |
265 | |
266 fd = FuncDeclaration.genCfunc(Type.tsize_t, Id.aaLen); | |
267 ec = new VarExp(Loc(0), fd); | |
268 arguments = new Expressions(); | |
84
be2ab491772e
Expressions -> Vector!Expression
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
73
diff
changeset
|
269 arguments.push(e); |
0 | 270 e = new CallExp(e.loc, ec, arguments); |
271 e.type = (cast(TypeFunction)fd.type).next; | |
272 } | |
273 else if (ident == Id.keys) | |
274 { | |
275 Expression ec; | |
276 FuncDeclaration fd; | |
277 Expressions arguments; | |
278 int size = cast(int)index.size(e.loc); | |
279 | |
280 assert(size); | |
281 fd = FuncDeclaration.genCfunc(Type.tindex, Id.aaKeys); | |
282 ec = new VarExp(Loc(0), fd); | |
283 arguments = new Expressions(); | |
84
be2ab491772e
Expressions -> Vector!Expression
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
73
diff
changeset
|
284 arguments.push(e); |
be2ab491772e
Expressions -> Vector!Expression
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
73
diff
changeset
|
285 arguments.push(new IntegerExp(Loc(0), size, Type.tsize_t)); |
0 | 286 e = new CallExp(e.loc, ec, arguments); |
287 e.type = index.arrayOf(); | |
288 } | |
289 else if (ident == Id.values) | |
290 { | |
291 Expression ec; | |
292 FuncDeclaration fd; | |
293 Expressions arguments; | |
294 | |
295 fd = FuncDeclaration.genCfunc(Type.tindex, Id.aaValues); | |
296 ec = new VarExp(Loc(0), fd); | |
297 arguments = new Expressions(); | |
84
be2ab491772e
Expressions -> Vector!Expression
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
73
diff
changeset
|
298 arguments.push(e); |
0 | 299 size_t keysize = cast(size_t)index.size(e.loc); |
300 keysize = (keysize + PTRSIZE - 1) & ~(PTRSIZE - 1); | |
84
be2ab491772e
Expressions -> Vector!Expression
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
73
diff
changeset
|
301 arguments.push(new IntegerExp(Loc(0), keysize, Type.tsize_t)); |
be2ab491772e
Expressions -> Vector!Expression
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
73
diff
changeset
|
302 arguments.push(new IntegerExp(Loc(0), next.size(e.loc), Type.tsize_t)); |
0 | 303 e = new CallExp(e.loc, ec, arguments); |
304 e.type = next.arrayOf(); | |
305 } | |
306 else if (ident == Id.rehash) | |
307 { | |
308 Expression ec; | |
309 FuncDeclaration fd; | |
310 Expressions arguments; | |
311 | |
312 fd = FuncDeclaration.genCfunc(Type.tint64, Id.aaRehash); | |
313 ec = new VarExp(Loc(0), fd); | |
314 arguments = new Expressions(); | |
84
be2ab491772e
Expressions -> Vector!Expression
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
73
diff
changeset
|
315 arguments.push(e.addressOf(sc)); |
be2ab491772e
Expressions -> Vector!Expression
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
73
diff
changeset
|
316 arguments.push(index.getInternalTypeInfo(sc)); |
0 | 317 e = new CallExp(e.loc, ec, arguments); |
318 e.type = this; | |
319 } | |
96 | 320 // else |
321 } // of static if (false) | |
0 | 322 { |
96 | 323 e.type = getImpl().type; |
324 e = e.type.dotExp(sc, e, ident); | |
325 //e = Type.dotExp(sc, e, ident); | |
0 | 326 } |
327 return e; | |
328 } | |
329 | |
72 | 330 override Expression defaultInit(Loc loc) |
0 | 331 { |
332 version (LOGDEFAULTINIT) { | |
333 printf("TypeAArray.defaultInit() '%s'\n", toChars()); | |
334 } | |
135 | 335 return new NullExp(loc, this); |
0 | 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 { |
129 | 360 return true; |
0 | 361 } |
362 | |
72 | 363 override bool checkBoolean() |
0 | 364 { |
129 | 365 return true; |
0 | 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 | |
135 | 388 if (!MODimplicitConv(next.mod, ta.next.mod)) |
51 | 389 return MATCHnomatch; // not const-compatible |
390 | |
135 | 391 if (!MODimplicitConv(index.mod, ta.index.mod)) |
51 | 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 //printf("aaGetSymbol(func = '%s', flags = %d, key = %p)\n", func, flags, key); | |
447 static if (false) { | |
448 scope OutBuffer buf = new OutBuffer(); | |
449 key.toKeyBuffer(buf); | |
450 | |
451 sz = next.size(); // it's just data, so we only care about the size | |
452 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
|
453 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
|
454 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
|
455 else |
0 | 456 id = cast(char*)alloca(3 + strlen(func) + buf.offset + sizeof(sz) * 3 + 1); |
457 buf.writeByte(0); | |
458 if (flags & 1) | |
459 sprintf(id, "_aa%s%s%d", func, buf.data, sz); | |
460 else | |
461 sprintf(id, "_aa%s%s", func, buf.data); | |
462 } 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
|
463 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
|
464 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
|
465 else |
0 | 466 id = cast(char*)alloca(3 + strlen(func) + 1); |
467 sprintf(id, "_aa%s", func); | |
468 } | |
469 | |
470 // See if symbol is already in sarray | |
176 | 471 for (i = 0; i < global.sarray.dim; i++) |
0 | 472 { |
176 | 473 s = cast(Symbol*)global.sarray.data[i]; |
0 | 474 if (strcmp(id, s.Sident.ptr) == 0) |
475 return s; // use existing Symbol | |
476 } | |
477 | |
478 // Create new Symbol | |
479 | |
480 s = symbol_calloc(id); | |
481 slist_add(s); | |
482 s.Sclass = SCextern; | |
483 s.Ssymnum = -1; | |
484 symbol_func(s); | |
485 | |
486 t = type_alloc(TYnfunc); | |
487 t.Tflags = TFprototype | TFfixed; | |
488 t.Tmangle = mTYman_c; | |
489 t.Tparamtypes = null; | |
490 t.Tnext = next.toCtype(); | |
491 t.Tnext.Tcount++; | |
492 t.Tcount++; | |
493 s.Stype = t; | |
494 | |
176 | 495 global.sarray.push(s); // remember it |
0 | 496 return s; |
497 } | |
498 | |
72 | 499 override type* toCtype() |
0 | 500 { |
67 | 501 type* t; |
502 | |
503 if (ctype) | |
504 return ctype; | |
505 | |
506 if (0 && global.params.symdebug) | |
507 { | |
508 /* An associative array is represented by: | |
509 * struct AArray { size_t length; void* ptr; } | |
510 */ | |
511 | |
176 | 512 auto s = global.AArray_s; |
67 | 513 if (!s) |
514 { | |
176 | 515 global.AArray_s = s = symbol_calloc("_AArray"); |
67 | 516 s.Sclass = SCstruct; |
517 s.Sstruct = struct_calloc(); | |
518 s.Sstruct.Sflags |= 0; | |
519 s.Sstruct.Salignsize = alignsize(); | |
520 s.Sstruct.Sstructalign = cast(ubyte)global.structalign; | |
521 s.Sstruct.Sstructsize = cast(uint)size(Loc(0)); | |
522 slist_add(s); | |
523 | |
524 Symbol* s1 = symbol_name("length", SCmember, Type.tsize_t.toCtype()); | |
525 list_append(&s.Sstruct.Sfldlst, s1); | |
526 | |
176 | 527 Symbol* s2 = symbol_name("data", SCmember, global.tvoidptr.toCtype()); |
67 | 528 s2.Smemoff = cast(uint)Type.tsize_t.size(); |
529 list_append(&s.Sstruct.Sfldlst, s2); | |
530 } | |
531 | |
532 t = type_alloc(TYstruct); | |
533 t.Ttag = cast(Classsym*)s; // structure tag name | |
534 t.Tcount++; | |
535 s.Stype = t; | |
536 } | |
537 else | |
538 { | |
539 if (global.params.symdebug == 1) | |
540 { | |
541 /* Generate D symbolic debug info, rather than C | |
542 * Tnext: element type | |
543 * Tkey: key type | |
544 */ | |
545 t = type_allocn(TYaarray, next.toCtype()); | |
546 t.Tkey = index.toCtype(); | |
547 t.Tkey.Tcount++; | |
548 } | |
549 else | |
550 t = type_fake(TYaarray); | |
551 } | |
552 t.Tcount++; | |
553 ctype = t; | |
554 return t; | |
0 | 555 } |
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
|
556 } |