comparison tango/lib/compiler/llvmdc/lifetime.d @ 305:2b72433d5c8c trunk

[svn r326] Fixed a bunch of issues with printf's that MinGW32 did not support. Fixed problems with label collisions when using labels inside inline asm. LabelStatement is now easily reached given its Identifier, which should be useful elsewhere too. Enabled inline asm for building the lib/compiler/llvmdc runtime code, fixing branches out of asm makes this possible.
author lindquist
date Fri, 27 Jun 2008 22:04:35 +0200
parents a3b7c19c866c
children
comparison
equal deleted inserted replaced
304:3ebc136702dd 305:2b72433d5c8c
26 */ 26 */
27 module lifetime; 27 module lifetime;
28 28
29 //debug=PRINTF; 29 //debug=PRINTF;
30 //debug=PRINTF2; 30 //debug=PRINTF2;
31
32 // we're not allowed to jump out of asm blocks
33 //version(D_InlineAsm_X86) version = Asm86;
34 31
35 private 32 private
36 { 33 {
37 import tango.stdc.stdlib; 34 import tango.stdc.stdlib;
38 import tango.stdc.string; 35 import tango.stdc.string;
211 208
212 debug(PRINTF) printf("_d_newarrayT(length = %u, size = %d)\n", length, size); 209 debug(PRINTF) printf("_d_newarrayT(length = %u, size = %d)\n", length, size);
213 if (length == 0 || size == 0) 210 if (length == 0 || size == 0)
214 return null; 211 return null;
215 212
216 version (Asm86) 213 version (D_InlineAsm_X86)
217 { 214 {
218 asm 215 asm
219 { 216 {
220 mov EAX,size ; 217 mov EAX,size ;
221 mul EAX,length ; 218 mul EAX,length ;
250 else 247 else
251 { 248 {
252 auto initializer = ti.next.init(); 249 auto initializer = ti.next.init();
253 auto isize = initializer.length; 250 auto isize = initializer.length;
254 auto q = initializer.ptr; 251 auto q = initializer.ptr;
255 version (Asm86) 252 version (D_InlineAsm_X86)
256 { 253 {
257 asm 254 asm
258 { 255 {
259 mov EAX,size ; 256 mov EAX,size ;
260 mul EAX,length ; 257 mul EAX,length ;
513 printf("\tp.data = %p, p.length = %d\n", pdata, plength); 510 printf("\tp.data = %p, p.length = %d\n", pdata, plength);
514 } 511 }
515 512
516 if (newlength) 513 if (newlength)
517 { 514 {
518 version (Asm86) 515 version (D_InlineAsm_X86)
519 { 516 {
520 size_t newsize = void; 517 size_t newsize = void;
521 518
522 asm 519 asm
523 { 520 {
612 printf("\tp.data = %p, p.length = %d\n", pdata, plength); 609 printf("\tp.data = %p, p.length = %d\n", pdata, plength);
613 } 610 }
614 611
615 if (newlength) 612 if (newlength)
616 { 613 {
617 version (Asm86) 614 version (D_InlineAsm_X86)
618 { 615 {
619 size_t newsize = void; 616 size_t newsize = void;
620 617
621 asm 618 asm
622 { 619 {