Mercurial > projects > ddmd
annotate dmd/SwitchErrorStatement.d @ 132:c494af1dba80
Fixes for dmd 2.037
author | Eldar Insafutdinov <e.insafutdinov@gmail.com> |
---|---|
date | Fri, 10 Sep 2010 19:14:09 +0100 |
parents | e28b18c23469 |
children | e3afd1303184 |
rev | line source |
---|---|
72 | 1 module dmd.SwitchErrorStatement; |
2 | |
114 | 3 import dmd.common; |
72 | 4 import dmd.Statement; |
5 import dmd.OutBuffer; | |
6 import dmd.Loc; | |
7 import dmd.IRState; | |
0 | 8 import dmd.HdrGenState; |
5
63623152e82a
Fixed memory corruption bug which was introduced when attempting to restore GC functionality
dkoroskin <>
parents:
0
diff
changeset
|
9 import dmd.BE; |
63623152e82a
Fixed memory corruption bug which was introduced when attempting to restore GC functionality
dkoroskin <>
parents:
0
diff
changeset
|
10 |
63623152e82a
Fixed memory corruption bug which was introduced when attempting to restore GC functionality
dkoroskin <>
parents:
0
diff
changeset
|
11 import dmd.backend.elem; |
63623152e82a
Fixed memory corruption bug which was introduced when attempting to restore GC functionality
dkoroskin <>
parents:
0
diff
changeset
|
12 import dmd.backend.Blockx; |
63623152e82a
Fixed memory corruption bug which was introduced when attempting to restore GC functionality
dkoroskin <>
parents:
0
diff
changeset
|
13 import dmd.backend.Util; |
63623152e82a
Fixed memory corruption bug which was introduced when attempting to restore GC functionality
dkoroskin <>
parents:
0
diff
changeset
|
14 import dmd.backend.TYM; |
63623152e82a
Fixed memory corruption bug which was introduced when attempting to restore GC functionality
dkoroskin <>
parents:
0
diff
changeset
|
15 import dmd.backend.OPER; |
72 | 16 import dmd.backend.RTLSYM; |
17 | |
0 | 18 class SwitchErrorStatement : Statement |
19 { | |
20 this(Loc loc) | |
21 { | |
22 super(loc); | |
23 } | |
24 | |
72 | 25 override BE blockExit() |
0 | 26 { |
5
63623152e82a
Fixed memory corruption bug which was introduced when attempting to restore GC functionality
dkoroskin <>
parents:
0
diff
changeset
|
27 return BE.BEthrow; |
0 | 28 } |
29 | |
72 | 30 override void toCBuffer(OutBuffer buf, HdrGenState* hgs) |
0 | 31 { |
5
63623152e82a
Fixed memory corruption bug which was introduced when attempting to restore GC functionality
dkoroskin <>
parents:
0
diff
changeset
|
32 buf.writestring("SwitchErrorStatement.toCBuffer()"); |
63623152e82a
Fixed memory corruption bug which was introduced when attempting to restore GC functionality
dkoroskin <>
parents:
0
diff
changeset
|
33 buf.writenl(); |
0 | 34 } |
35 | |
72 | 36 override void toIR(IRState* irs) |
0 | 37 { |
5
63623152e82a
Fixed memory corruption bug which was introduced when attempting to restore GC functionality
dkoroskin <>
parents:
0
diff
changeset
|
38 elem* e; |
63623152e82a
Fixed memory corruption bug which was introduced when attempting to restore GC functionality
dkoroskin <>
parents:
0
diff
changeset
|
39 elem* elinnum; |
63623152e82a
Fixed memory corruption bug which was introduced when attempting to restore GC functionality
dkoroskin <>
parents:
0
diff
changeset
|
40 elem* efilename; |
63623152e82a
Fixed memory corruption bug which was introduced when attempting to restore GC functionality
dkoroskin <>
parents:
0
diff
changeset
|
41 Blockx* blx = irs.blx; |
63623152e82a
Fixed memory corruption bug which was introduced when attempting to restore GC functionality
dkoroskin <>
parents:
0
diff
changeset
|
42 |
63623152e82a
Fixed memory corruption bug which was introduced when attempting to restore GC functionality
dkoroskin <>
parents:
0
diff
changeset
|
43 //printf("SwitchErrorStatement.toIR()\n"); |
63623152e82a
Fixed memory corruption bug which was introduced when attempting to restore GC functionality
dkoroskin <>
parents:
0
diff
changeset
|
44 |
63623152e82a
Fixed memory corruption bug which was introduced when attempting to restore GC functionality
dkoroskin <>
parents:
0
diff
changeset
|
45 efilename = blx.module_.toEmodulename(); |
63623152e82a
Fixed memory corruption bug which was introduced when attempting to restore GC functionality
dkoroskin <>
parents:
0
diff
changeset
|
46 elinnum = el_long(TYM.TYint, loc.linnum); |
63623152e82a
Fixed memory corruption bug which was introduced when attempting to restore GC functionality
dkoroskin <>
parents:
0
diff
changeset
|
47 e = el_bin(OPER.OPcall, TYM.TYvoid, el_var(rtlsym[RTLSYM_DSWITCHERR]), el_param(elinnum, efilename)); |
63623152e82a
Fixed memory corruption bug which was introduced when attempting to restore GC functionality
dkoroskin <>
parents:
0
diff
changeset
|
48 block_appendexp(blx.curblock, e); |
0 | 49 } |
50 } | |
51 |