Mercurial > projects > ddmd
annotate dmd/LineInitExp.d @ 178:e3afd1303184
Many small bugs fixed
Made all classes derive from TObject to detect memory leaks (functionality is disabled for now)
Began work on overriding backend memory allocations (to avoid memory leaks)
author | korDen |
---|---|
date | Sun, 17 Oct 2010 07:42:00 +0400 |
parents | 60bb0fe4563e |
children | b0d41ff5e0df |
rev | line source |
---|---|
72 | 1 module dmd.LineInitExp; |
2 | |
114 | 3 import dmd.common; |
72 | 4 import dmd.Expression; |
5 import dmd.Loc; | |
6 import dmd.Scope; | |
7 import dmd.DefaultInitExp; | |
8 import dmd.IntegerExp; | |
9 import dmd.TOK; | |
10 import dmd.Type; | |
11 | |
12 class LineInitExp : DefaultInitExp | |
13 { | |
14 this(Loc loc) | |
15 { | |
178 | 16 register(); |
72 | 17 super(loc, TOK.TOKline, this.sizeof); |
18 } | |
19 | |
20 override Expression semantic(Scope sc) | |
21 { | |
22 type = Type.tint32; | |
23 return this; | |
24 } | |
25 | |
130
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
114
diff
changeset
|
26 override Expression resolveLoc(Loc loc, Scope sc) |
72 | 27 { |
28 Expression e = new IntegerExp(loc, loc.linnum, Type.tint32); | |
29 e = e.castTo(sc, type); | |
30 return e; | |
31 } | |
32 } |