Mercurial > projects > ddmd
annotate dmd/TypeInfoStaticArrayDeclaration.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 |
rev | line source |
---|---|
64 | 1 module dmd.TypeInfoStaticArrayDeclaration; |
2 | |
114 | 3 import dmd.common; |
64 | 4 import dmd.Type; |
174 | 5 import dmd.Global; |
64 | 6 import dmd.TypeInfoDeclaration; |
68
ee3a9f34dc48
final bits of codegen implementation to compile Phobos
korDen
parents:
64
diff
changeset
|
7 import dmd.TypeSArray; |
ee3a9f34dc48
final bits of codegen implementation to compile Phobos
korDen
parents:
64
diff
changeset
|
8 import dmd.TY; |
ee3a9f34dc48
final bits of codegen implementation to compile Phobos
korDen
parents:
64
diff
changeset
|
9 |
ee3a9f34dc48
final bits of codegen implementation to compile Phobos
korDen
parents:
64
diff
changeset
|
10 import dmd.backend.Util; |
ee3a9f34dc48
final bits of codegen implementation to compile Phobos
korDen
parents:
64
diff
changeset
|
11 import dmd.backend.TYM; |
64 | 12 import dmd.backend.dt_t; |
13 | |
187
b0d41ff5e0df
Added expandability scheme outlined in http://www.dsource.org/forums/viewtopic.php?t=5659&sid=6f2150ff5b0bffcd47512a6a7608d218
Abscissa
parents:
178
diff
changeset
|
14 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
|
15 |
64 | 16 class TypeInfoStaticArrayDeclaration : TypeInfoDeclaration |
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 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
|
19 |
64 | 20 this(Type tinfo) |
21 { | |
178 | 22 register(); |
64 | 23 super(tinfo, 0); |
174 | 24 type = global.typeinfostaticarray.type; |
64 | 25 } |
26 | |
72 | 27 override void toDt(dt_t** pdt) |
64 | 28 { |
68
ee3a9f34dc48
final bits of codegen implementation to compile Phobos
korDen
parents:
64
diff
changeset
|
29 //printf("TypeInfoStaticArrayDeclaration.toDt()\n"); |
174 | 30 dtxoff(pdt, global.typeinfostaticarray.toVtblSymbol(), 0, TYnptr); // vtbl for TypeInfo_StaticArray |
68
ee3a9f34dc48
final bits of codegen implementation to compile Phobos
korDen
parents:
64
diff
changeset
|
31 dtdword(pdt, 0); // monitor |
ee3a9f34dc48
final bits of codegen implementation to compile Phobos
korDen
parents:
64
diff
changeset
|
32 |
ee3a9f34dc48
final bits of codegen implementation to compile Phobos
korDen
parents:
64
diff
changeset
|
33 assert(tinfo.ty == Tsarray); |
ee3a9f34dc48
final bits of codegen implementation to compile Phobos
korDen
parents:
64
diff
changeset
|
34 |
ee3a9f34dc48
final bits of codegen implementation to compile Phobos
korDen
parents:
64
diff
changeset
|
35 TypeSArray tc = cast(TypeSArray)tinfo; |
ee3a9f34dc48
final bits of codegen implementation to compile Phobos
korDen
parents:
64
diff
changeset
|
36 |
ee3a9f34dc48
final bits of codegen implementation to compile Phobos
korDen
parents:
64
diff
changeset
|
37 tc.next.getTypeInfo(null); |
ee3a9f34dc48
final bits of codegen implementation to compile Phobos
korDen
parents:
64
diff
changeset
|
38 dtxoff(pdt, tc.next.vtinfo.toSymbol(), 0, TYnptr); // TypeInfo for array of type |
ee3a9f34dc48
final bits of codegen implementation to compile Phobos
korDen
parents:
64
diff
changeset
|
39 |
ee3a9f34dc48
final bits of codegen implementation to compile Phobos
korDen
parents:
64
diff
changeset
|
40 dtdword(pdt, cast(int)tc.dim.toInteger()); // length |
64 | 41 } |
72 | 42 } |