Mercurial > projects > ddmd
comparison dmd/TemplateInstance.d @ 128:e6e542f37b94
Some more Array -> Vector conversions
author | Eldar Insafutdinov <e.insafutdinov@gmail.com> |
---|---|
date | Sat, 04 Sep 2010 01:33:05 +0100 |
parents | 1765f3ef917d |
children | 60bb0fe4563e |
comparison
equal
deleted
inserted
replaced
127:9ee9b55452cb | 128:e6e542f37b94 |
---|---|
335 | 335 |
336 /* See if there is an existing TemplateInstantiation that already | 336 /* See if there is an existing TemplateInstantiation that already |
337 * implements the typeargs. If so, just refer to that one instead. | 337 * implements the typeargs. If so, just refer to that one instead. |
338 */ | 338 */ |
339 | 339 |
340 for (size_t i = 0; i < tempdecl.instances.dim; i++) | 340 foreach (ti; tempdecl.instances) |
341 { | 341 { |
342 TemplateInstance ti = cast(TemplateInstance)tempdecl.instances.data[i]; | |
343 version (LOG) { | 342 version (LOG) { |
344 printf("\t%s: checking for match with instance %d (%p): '%s'\n", toChars(), i, ti, ti.toChars()); | 343 printf("\t%s: checking for match with instance %d (%p): '%s'\n", toChars(), i, ti, ti.toChars()); |
345 } | 344 } |
346 assert(tdtypes.dim == ti.tdtypes.dim); | 345 assert(tdtypes.dim == ti.tdtypes.dim); |
347 | 346 |
383 printf("\timplement template instance '%s'\n", toChars()); | 382 printf("\timplement template instance '%s'\n", toChars()); |
384 } | 383 } |
385 uint errorsave = global.errors; | 384 uint errorsave = global.errors; |
386 inst = this; | 385 inst = this; |
387 int tempdecl_instance_idx = tempdecl.instances.dim; | 386 int tempdecl_instance_idx = tempdecl.instances.dim; |
388 tempdecl.instances.push(cast(void*)this); | 387 tempdecl.instances.push(this); |
389 parent = tempdecl.parent; | 388 parent = tempdecl.parent; |
390 //printf("parent = '%s'\n", parent.kind()); | 389 //printf("parent = '%s'\n", parent.kind()); |
391 | 390 |
392 ident = genIdent(); // need an identifier for name mangling purposes. | 391 ident = genIdent(); // need an identifier for name mangling purposes. |
393 | 392 |