Mercurial > projects > ddmd
comparison dmd/SwitchStatement.d @ 2:7427ded8caf7
Removed unreferenced modules
First step at fixing GC issues - now calling GC.malloc instead of malloc (ditto calloc and realloc), get rid of free
author | korDen |
---|---|
date | Sun, 25 Oct 2009 03:20:59 +0300 |
parents | 10317f0c89a5 |
children | d706d958e4e8 |
comparison
equal
deleted
inserted
replaced
1:5a2059196104 | 2:7427ded8caf7 |
---|---|
45 import dmd.backend.SC; | 45 import dmd.backend.SC; |
46 import dmd.backend.FL; | 46 import dmd.backend.FL; |
47 import dmd.backend.RTLSYM; | 47 import dmd.backend.RTLSYM; |
48 import dmd.backend.targ_types; | 48 import dmd.backend.targ_types; |
49 | 49 |
50 import dmd.Memory; | |
51 | |
50 class SwitchStatement : Statement | 52 class SwitchStatement : Statement |
51 { | 53 { |
52 Expression condition; | 54 Expression condition; |
53 Statement body_; | 55 Statement body_; |
54 bool isFinal; | 56 bool isFinal; |
404 else | 406 else |
405 string = 0; | 407 string = 0; |
406 block_appendexp(mystate.switchBlock, econd); | 408 block_appendexp(mystate.switchBlock, econd); |
407 block_next(blx,BCswitch,null); | 409 block_next(blx,BCswitch,null); |
408 | 410 |
409 targ_llong* pu = cast(targ_llong*) malloc(targ_llong.sizeof * (numcases + 1)); | 411 targ_llong* pu = cast(targ_llong*) GC.malloc(targ_llong.sizeof * (numcases + 1)); |
410 mystate.switchBlock.Bswitch = pu; | 412 mystate.switchBlock.Bswitch = pu; |
411 /* First pair is the number of cases, and the default block | 413 /* First pair is the number of cases, and the default block |
412 */ | 414 */ |
413 *pu++ = numcases; | 415 *pu++ = numcases; |
414 list_append(&mystate.switchBlock.Bsucc, mystate.defaultBlock); | 416 list_append(&mystate.switchBlock.Bsucc, mystate.defaultBlock); |