Mercurial > projects > ddmd
annotate dmd/TypeInfoClassDeclaration.d @ 161:584dc990e12f
type fixed
author | korDen |
---|---|
date | Mon, 20 Sep 2010 01:19:36 +0400 |
parents | 60bb0fe4563e |
children | af724d3510d7 |
rev | line source |
---|---|
72 | 1 module dmd.TypeInfoClassDeclaration; |
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; | |
72 | 9 import dmd.Util; |
0 | 10 import dmd.backend.dt_t; |
11 import dmd.backend.Util; | |
12 import dmd.backend.TYM; | |
72 | 13 import dmd.backend.Symbol; |
14 | |
0 | 15 class TypeInfoClassDeclaration : TypeInfoDeclaration |
16 { | |
17 this(Type tinfo) | |
18 { | |
19 super(tinfo, 0); | |
73 | 20 type = Type.typeinfostruct.type; |
0 | 21 } |
22 | |
130
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
114
diff
changeset
|
23 override Symbol* toSymbol() |
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
114
diff
changeset
|
24 { |
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
114
diff
changeset
|
25 //printf("TypeInfoClassDeclaration::toSymbol(%s), linkage = %d\n", toChars(), linkage); |
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
114
diff
changeset
|
26 assert(tinfo.ty == TY.Tclass); |
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
114
diff
changeset
|
27 auto tc = cast(TypeClass)tinfo; |
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
114
diff
changeset
|
28 return tc.sym.toSymbol(); |
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
114
diff
changeset
|
29 } |
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
114
diff
changeset
|
30 |
72 | 31 override void toDt(dt_t** pdt) |
0 | 32 { |
33 //printf("TypeInfoClassDeclaration::toDt() %s\n", tinfo->toChars()); | |
130
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
114
diff
changeset
|
34 assert(0); |
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
114
diff
changeset
|
35 static if(false) { |
0 | 36 dtxoff(pdt, Type.typeinfoclass.toVtblSymbol(), 0, TYnptr); // vtbl for TypeInfoClass |
37 dtdword(pdt, 0); // monitor | |
38 | |
39 assert(tinfo.ty == Tclass); | |
40 | |
41 TypeClass tc = cast(TypeClass)tinfo; | |
42 | |
43 if (!tc.sym.vclassinfo) | |
44 tc.sym.vclassinfo = new ClassInfoDeclaration(tc.sym); | |
45 | |
46 Symbol* s = tc.sym.vclassinfo.toSymbol(); | |
47 assert(s.Sxtrnnum == 0); | |
48 | |
49 dtxoff(pdt, s, 0, TYnptr); // ClassInfo for tinfo | |
130
60bb0fe4563e
dmdfe 2.037 first main iteration
Eldar Insafutdinov <e.insafutdinov@gmail.com>
parents:
114
diff
changeset
|
50 } |
0 | 51 } |
52 } | |
53 |