Mercurial > projects > ddmd
annotate dmd/VoidInitializer.d @ 72:2e2a5c3f943a
reduced warnings by adding override to the methods
think this also normalizes different line endings used all over the place
author | Trass3r |
---|---|
date | Sat, 28 Aug 2010 16:19:48 +0200 |
parents | ee3a9f34dc48 |
children | e28b18c23469 |
rev | line source |
---|---|
0 | 1 module dmd.VoidInitializer; |
2 | |
3 import dmd.Initializer; | |
4 import dmd.Type; | |
5 import dmd.Loc; | |
6 import dmd.Scope; | |
7 import dmd.Expression; | |
8 import dmd.OutBuffer; | |
9 import dmd.HdrGenState; | |
10 | |
11 import dmd.backend.dt_t; | |
68
ee3a9f34dc48
final bits of codegen implementation to compile Phobos
korDen
parents:
51
diff
changeset
|
12 import dmd.backend.Util; |
0 | 13 |
14 class VoidInitializer : Initializer | |
15 { | |
16 Type type = null; // type that this will initialize to | |
17 | |
18 this(Loc loc) | |
19 { | |
20 super(loc); | |
21 } | |
22 | |
72 | 23 override Initializer syntaxCopy() |
0 | 24 { |
51 | 25 return new VoidInitializer(loc); |
0 | 26 } |
27 | |
72 | 28 override Initializer semantic(Scope sc, Type t) |
0 | 29 { |
30 //printf("VoidInitializer.semantic(t = %p)\n", t); | |
31 type = t; | |
32 return this; | |
33 } | |
34 | |
72 | 35 override Expression toExpression() |
0 | 36 { |
37 assert(false); | |
38 } | |
39 | |
72 | 40 override void toCBuffer(OutBuffer buf, HdrGenState* hgs) |
0 | 41 { |
42 assert(false); | |
43 } | |
44 | |
72 | 45 override dt_t* toDt() |
0 | 46 { |
68
ee3a9f34dc48
final bits of codegen implementation to compile Phobos
korDen
parents:
51
diff
changeset
|
47 /* Void initializers are set to 0, just because we need something |
ee3a9f34dc48
final bits of codegen implementation to compile Phobos
korDen
parents:
51
diff
changeset
|
48 * to set them to in the static data segment. |
ee3a9f34dc48
final bits of codegen implementation to compile Phobos
korDen
parents:
51
diff
changeset
|
49 */ |
ee3a9f34dc48
final bits of codegen implementation to compile Phobos
korDen
parents:
51
diff
changeset
|
50 dt_t *dt = null; |
ee3a9f34dc48
final bits of codegen implementation to compile Phobos
korDen
parents:
51
diff
changeset
|
51 |
ee3a9f34dc48
final bits of codegen implementation to compile Phobos
korDen
parents:
51
diff
changeset
|
52 dtnzeros(&dt, cast(uint)type.size()); |
ee3a9f34dc48
final bits of codegen implementation to compile Phobos
korDen
parents:
51
diff
changeset
|
53 return dt; |
0 | 54 } |
55 | |
72 | 56 override VoidInitializer isVoidInitializer() { return this; } |
57 } |