annotate dmd/SwitchErrorStatement.d @ 191:52188e7e3fb5

Fixed deprecated features, now compiles with DMD2.058 Also changed Array allocation policy: Now doesn't reallocate but malloc's, followed by a memcpy (no free). (this fixes a crash while compiling druntime. Same bug in dmd)
author korDen@korDen-pc
date Sun, 25 Mar 2012 03:11:12 +0400
parents b0d41ff5e0df
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
72
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 5
diff changeset
1 module dmd.SwitchErrorStatement;
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 5
diff changeset
2
114
e28b18c23469 added a module dmd.common for commonly used stuff
Trass3r
parents: 72
diff changeset
3 import dmd.common;
72
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 5
diff changeset
4 import dmd.Statement;
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 5
diff changeset
5 import dmd.OutBuffer;
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 5
diff changeset
6 import dmd.Loc;
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 5
diff changeset
7 import dmd.IRState;
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
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
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 5
diff changeset
16 import dmd.backend.RTLSYM;
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 5
diff changeset
17
187
b0d41ff5e0df Added expandability scheme outlined in http://www.dsource.org/forums/viewtopic.php?t=5659&sid=6f2150ff5b0bffcd47512a6a7608d218
Abscissa
parents: 178
diff changeset
18 import dmd.DDMDExtensions;
b0d41ff5e0df Added expandability scheme outlined in http://www.dsource.org/forums/viewtopic.php?t=5659&sid=6f2150ff5b0bffcd47512a6a7608d218
Abscissa
parents: 178
diff changeset
19
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
20 class SwitchErrorStatement : Statement
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
21 {
187
b0d41ff5e0df Added expandability scheme outlined in http://www.dsource.org/forums/viewtopic.php?t=5659&sid=6f2150ff5b0bffcd47512a6a7608d218
Abscissa
parents: 178
diff changeset
22 mixin insertMemberExtension!(typeof(this));
b0d41ff5e0df Added expandability scheme outlined in http://www.dsource.org/forums/viewtopic.php?t=5659&sid=6f2150ff5b0bffcd47512a6a7608d218
Abscissa
parents: 178
diff changeset
23
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
24 this(Loc loc)
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
25 {
178
e3afd1303184 Many small bugs fixed
korDen
parents: 114
diff changeset
26 register();
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
27 super(loc);
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
28 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
29
72
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 5
diff changeset
30 override BE blockExit()
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
31 {
5
63623152e82a Fixed memory corruption bug which was introduced when attempting to restore GC functionality
dkoroskin <>
parents: 0
diff changeset
32 return BE.BEthrow;
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
33 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
34
72
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 5
diff changeset
35 override void toCBuffer(OutBuffer buf, HdrGenState* hgs)
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
36 {
5
63623152e82a Fixed memory corruption bug which was introduced when attempting to restore GC functionality
dkoroskin <>
parents: 0
diff changeset
37 buf.writestring("SwitchErrorStatement.toCBuffer()");
63623152e82a Fixed memory corruption bug which was introduced when attempting to restore GC functionality
dkoroskin <>
parents: 0
diff changeset
38 buf.writenl();
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
39 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
40
72
2e2a5c3f943a reduced warnings by adding override to the methods
Trass3r
parents: 5
diff changeset
41 override void toIR(IRState* irs)
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
42 {
5
63623152e82a Fixed memory corruption bug which was introduced when attempting to restore GC functionality
dkoroskin <>
parents: 0
diff changeset
43 elem* e;
63623152e82a Fixed memory corruption bug which was introduced when attempting to restore GC functionality
dkoroskin <>
parents: 0
diff changeset
44 elem* elinnum;
63623152e82a Fixed memory corruption bug which was introduced when attempting to restore GC functionality
dkoroskin <>
parents: 0
diff changeset
45 elem* efilename;
63623152e82a Fixed memory corruption bug which was introduced when attempting to restore GC functionality
dkoroskin <>
parents: 0
diff changeset
46 Blockx* blx = irs.blx;
63623152e82a Fixed memory corruption bug which was introduced when attempting to restore GC functionality
dkoroskin <>
parents: 0
diff changeset
47
63623152e82a Fixed memory corruption bug which was introduced when attempting to restore GC functionality
dkoroskin <>
parents: 0
diff changeset
48 //printf("SwitchErrorStatement.toIR()\n");
63623152e82a Fixed memory corruption bug which was introduced when attempting to restore GC functionality
dkoroskin <>
parents: 0
diff changeset
49
63623152e82a Fixed memory corruption bug which was introduced when attempting to restore GC functionality
dkoroskin <>
parents: 0
diff changeset
50 efilename = blx.module_.toEmodulename();
63623152e82a Fixed memory corruption bug which was introduced when attempting to restore GC functionality
dkoroskin <>
parents: 0
diff changeset
51 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
52 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
53 block_appendexp(blx.curblock, e);
0
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
54 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
55 }
10317f0c89a5 Initial commit
korDen
parents:
diff changeset
56