Mercurial > projects > ddmd
annotate dmd/TypeAArray.d @ 161:584dc990e12f
type fixed
author | korDen |
---|---|
date | Mon, 20 Sep 2010 01:19:36 +0400 |
parents | af1bebfd96a4 |
children | af724d3510d7 |
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 | |
135 | 119 if (index.nextOf() && !index.nextOf().isImmutable()) |
0 | 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 } | |
135 | 333 return new NullExp(loc, this); |
0 | 334 } |
335 | |
72 | 336 override MATCH deduceType(Scope sc, Type tparam, TemplateParameters parameters, Objects dedtypes) |
0 | 337 { |
51 | 338 static if (false) { |
339 printf("TypeAArray.deduceType()\n"); | |
340 printf("\tthis = %d, ", ty); print(); | |
341 printf("\ttparam = %d, ", tparam.ty); tparam.print(); | |
342 } | |
343 | |
344 // Extra check that index type must match | |
345 if (tparam && tparam.ty == Taarray) | |
346 { | |
347 TypeAArray tp = cast(TypeAArray)tparam; | |
348 if (!index.deduceType(sc, tp.index, parameters, dedtypes)) | |
349 { | |
350 return MATCHnomatch; | |
351 } | |
352 } | |
353 return Type.deduceType(sc, tparam, parameters, dedtypes); | |
0 | 354 } |
355 | |
72 | 356 override bool isZeroInit(Loc loc) |
0 | 357 { |
129 | 358 return true; |
0 | 359 } |
360 | |
72 | 361 override bool checkBoolean() |
0 | 362 { |
129 | 363 return true; |
0 | 364 } |
365 | |
72 | 366 override TypeInfoDeclaration getTypeInfoDeclaration() |
0 | 367 { |
68
ee3a9f34dc48
final bits of codegen implementation to compile Phobos
korDen
parents:
67
diff
changeset
|
368 return new TypeInfoAssociativeArrayDeclaration(this); |
0 | 369 } |
370 | |
72 | 371 override bool hasPointers() |
0 | 372 { |
373 return true; | |
374 } | |
375 | |
72 | 376 override MATCH implicitConvTo(Type to) |
0 | 377 { |
51 | 378 //printf("TypeAArray.implicitConvTo(to = %s) this = %s\n", to.toChars(), toChars()); |
379 if (equals(to)) | |
380 return MATCHexact; | |
381 | |
382 if (to.ty == Taarray) | |
383 { | |
384 TypeAArray ta = cast(TypeAArray)to; | |
385 | |
135 | 386 if (!MODimplicitConv(next.mod, ta.next.mod)) |
51 | 387 return MATCHnomatch; // not const-compatible |
388 | |
135 | 389 if (!MODimplicitConv(index.mod, ta.index.mod)) |
51 | 390 return MATCHnomatch; // not const-compatible |
391 | |
392 MATCH m = next.constConv(ta.next); | |
393 MATCH mi = index.constConv(ta.index); | |
394 if (m != MATCHnomatch && mi != MATCHnomatch) | |
395 { | |
396 if (m == MATCHexact && mod != to.mod) | |
397 m = MATCHconst; | |
398 if (mi < m) | |
399 m = mi; | |
400 return m; | |
401 } | |
402 } | |
403 return Type.implicitConvTo(to); | |
0 | 404 } |
405 | |
72 | 406 override MATCH constConv(Type to) |
0 | 407 { |
408 assert(false); | |
409 } | |
410 | |
411 version (CPP_MANGLE) { | |
412 void toCppMangle(OutBuffer buf, CppMangleState* cms) | |
413 { | |
414 assert(false); | |
415 } | |
416 } | |
417 | |
418 // Back end | |
419 /******************************************** | |
420 * Determine the right symbol to look up | |
421 * an associative array element. | |
422 * Input: | |
423 * flags 0 don't add value signature | |
424 * 1 add value signature | |
425 */ | |
426 Symbol* aaGetSymbol(const(char)* func, int flags) | |
427 in | |
428 { | |
429 assert(func); | |
430 assert((flags & ~1) == 0); | |
431 } | |
432 out (result) | |
433 { | |
434 assert(result); | |
435 } | |
436 body | |
437 { | |
438 int sz; | |
439 char* id; | |
440 type* t; | |
441 Symbol* s; | |
442 int i; | |
443 | |
444 // Dumb linear symbol table - should use associative array! | |
445 static Array sarray = null; | |
446 | |
447 //printf("aaGetSymbol(func = '%s', flags = %d, key = %p)\n", func, flags, key); | |
448 static if (false) { | |
449 scope OutBuffer buf = new OutBuffer(); | |
450 key.toKeyBuffer(buf); | |
451 | |
452 sz = next.size(); // it's just data, so we only care about the size | |
453 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
|
454 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
|
455 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
|
456 else |
0 | 457 id = cast(char*)alloca(3 + strlen(func) + buf.offset + sizeof(sz) * 3 + 1); |
458 buf.writeByte(0); | |
459 if (flags & 1) | |
460 sprintf(id, "_aa%s%s%d", func, buf.data, sz); | |
461 else | |
462 sprintf(id, "_aa%s%s", func, buf.data); | |
463 } 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
|
464 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
|
465 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
|
466 else |
0 | 467 id = cast(char*)alloca(3 + strlen(func) + 1); |
468 sprintf(id, "_aa%s", func); | |
469 } | |
470 if (!sarray) | |
471 sarray = new Array(); | |
472 | |
473 // See if symbol is already in sarray | |
474 for (i = 0; i < sarray.dim; i++) | |
475 { | |
476 s = cast(Symbol*)sarray.data[i]; | |
477 if (strcmp(id, s.Sident.ptr) == 0) | |
478 return s; // use existing Symbol | |
479 } | |
480 | |
481 // Create new Symbol | |
482 | |
483 s = symbol_calloc(id); | |
484 slist_add(s); | |
485 s.Sclass = SCextern; | |
486 s.Ssymnum = -1; | |
487 symbol_func(s); | |
488 | |
489 t = type_alloc(TYnfunc); | |
490 t.Tflags = TFprototype | TFfixed; | |
491 t.Tmangle = mTYman_c; | |
492 t.Tparamtypes = null; | |
493 t.Tnext = next.toCtype(); | |
494 t.Tnext.Tcount++; | |
495 t.Tcount++; | |
496 s.Stype = t; | |
497 | |
498 sarray.push(s); // remember it | |
499 return s; | |
500 } | |
501 | |
72 | 502 override type* toCtype() |
0 | 503 { |
67 | 504 type* t; |
505 | |
506 if (ctype) | |
507 return ctype; | |
508 | |
509 if (0 && global.params.symdebug) | |
510 { | |
511 /* An associative array is represented by: | |
512 * struct AArray { size_t length; void* ptr; } | |
513 */ | |
514 | |
515 static Symbol* s; | |
516 | |
517 if (!s) | |
518 { | |
519 s = symbol_calloc("_AArray"); | |
520 s.Sclass = SCstruct; | |
521 s.Sstruct = struct_calloc(); | |
522 s.Sstruct.Sflags |= 0; | |
523 s.Sstruct.Salignsize = alignsize(); | |
524 s.Sstruct.Sstructalign = cast(ubyte)global.structalign; | |
525 s.Sstruct.Sstructsize = cast(uint)size(Loc(0)); | |
526 slist_add(s); | |
527 | |
528 Symbol* s1 = symbol_name("length", SCmember, Type.tsize_t.toCtype()); | |
529 list_append(&s.Sstruct.Sfldlst, s1); | |
530 | |
531 Symbol* s2 = symbol_name("data", SCmember, Type.tvoidptr.toCtype()); | |
532 s2.Smemoff = cast(uint)Type.tsize_t.size(); | |
533 list_append(&s.Sstruct.Sfldlst, s2); | |
534 } | |
535 | |
536 t = type_alloc(TYstruct); | |
537 t.Ttag = cast(Classsym*)s; // structure tag name | |
538 t.Tcount++; | |
539 s.Stype = t; | |
540 } | |
541 else | |
542 { | |
543 if (global.params.symdebug == 1) | |
544 { | |
545 /* Generate D symbolic debug info, rather than C | |
546 * Tnext: element type | |
547 * Tkey: key type | |
548 */ | |
549 t = type_allocn(TYaarray, next.toCtype()); | |
550 t.Tkey = index.toCtype(); | |
551 t.Tkey.Tcount++; | |
552 } | |
553 else | |
554 t = type_fake(TYaarray); | |
555 } | |
556 t.Tcount++; | |
557 ctype = t; | |
558 return t; | |
0 | 559 } |
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
|
560 } |