Mercurial > projects > ddmd
annotate dmd/TypeInfoInterfaceDeclaration.d @ 187:b0d41ff5e0df
Added expandability scheme outlined in http://www.dsource.org/forums/viewtopic.php?t=5659&sid=6f2150ff5b0bffcd47512a6a7608d218
author | Abscissa |
---|---|
date | Tue, 07 Jun 2011 23:37:34 -0400 |
parents | e3afd1303184 |
children |
rev | line source |
---|---|
72 | 1 module dmd.TypeInfoInterfaceDeclaration; |
2 | |
114 | 3 import dmd.common; |
72 | 4 import dmd.Type; |
0 | 5 import dmd.TypeInfoDeclaration; |
6 import dmd.ClassInfoDeclaration; | |
7 import dmd.TypeClass; | |
8 import dmd.TY; | |
174 | 9 import dmd.Global; |
131
206db751bd4c
dmdfe 2.037 compiles now
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
130
diff
changeset
|
10 import dmd.TypeInfoClassDeclaration; |
72 | 11 |
0 | 12 import dmd.backend.dt_t; |
13 import dmd.backend.Symbol; | |
14 import dmd.backend.Util; | |
72 | 15 import dmd.backend.TYM; |
16 | |
187
b0d41ff5e0df
Added expandability scheme outlined in http://www.dsource.org/forums/viewtopic.php?t=5659&sid=6f2150ff5b0bffcd47512a6a7608d218
Abscissa
parents:
178
diff
changeset
|
17 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
|
18 |
0 | 19 class TypeInfoInterfaceDeclaration : TypeInfoDeclaration |
20 { | |
187
b0d41ff5e0df
Added expandability scheme outlined in http://www.dsource.org/forums/viewtopic.php?t=5659&sid=6f2150ff5b0bffcd47512a6a7608d218
Abscissa
parents:
178
diff
changeset
|
21 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
|
22 |
0 | 23 this(Type tinfo) |
24 { | |
178 | 25 register(); |
0 | 26 super(tinfo, 0); |
174 | 27 type = global.typeinfointerface.type; |
0 | 28 } |
29 | |
72 | 30 override void toDt(dt_t** pdt) |
0 | 31 { |
32 //printf("TypeInfoInterfaceDeclaration.toDt() %s\n", tinfo.toChars()); | |
174 | 33 dtxoff(pdt, global.typeinfointerface.toVtblSymbol(), 0, TYnptr); // vtbl for TypeInfoInterface |
0 | 34 dtdword(pdt, 0); // monitor |
35 | |
36 assert(tinfo.ty == Tclass); | |
37 | |
38 TypeClass tc = cast(TypeClass)tinfo; | |
39 Symbol *s; | |
40 | |
41 if (!tc.sym.vclassinfo) | |
131
206db751bd4c
dmdfe 2.037 compiles now
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
130
diff
changeset
|
42 tc.sym.vclassinfo = new TypeInfoClassDeclaration(tc); |
0 | 43 s = tc.sym.vclassinfo.toSymbol(); |
44 dtxoff(pdt, s, 0, TYnptr); // ClassInfo for tinfo | |
45 } | |
46 } | |
47 |