Mercurial > projects > ddmd
comparison dmd/TypeInfoInterfaceDeclaration.d @ 0:10317f0c89a5
Initial commit
author | korDen |
---|---|
date | Sat, 24 Oct 2009 08:42:06 +0400 |
parents | |
children | 2e2a5c3f943a |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:10317f0c89a5 |
---|---|
1 module dmd.TypeInfoInterfaceDeclaration; | |
2 | |
3 import dmd.Type; | |
4 import dmd.TypeInfoDeclaration; | |
5 import dmd.ClassInfoDeclaration; | |
6 import dmd.TypeClass; | |
7 import dmd.TY; | |
8 | |
9 import dmd.backend.dt_t; | |
10 import dmd.backend.Symbol; | |
11 import dmd.backend.Util; | |
12 import dmd.backend.TYM; | |
13 | |
14 class TypeInfoInterfaceDeclaration : TypeInfoDeclaration | |
15 { | |
16 this(Type tinfo) | |
17 { | |
18 super(tinfo, 0); | |
19 } | |
20 | |
21 void toDt(dt_t** pdt) | |
22 { | |
23 //printf("TypeInfoInterfaceDeclaration.toDt() %s\n", tinfo.toChars()); | |
24 dtxoff(pdt, Type.typeinfointerface.toVtblSymbol(), 0, TYnptr); // vtbl for TypeInfoInterface | |
25 dtdword(pdt, 0); // monitor | |
26 | |
27 assert(tinfo.ty == Tclass); | |
28 | |
29 TypeClass tc = cast(TypeClass)tinfo; | |
30 Symbol *s; | |
31 | |
32 if (!tc.sym.vclassinfo) | |
33 tc.sym.vclassinfo = new ClassInfoDeclaration(tc.sym); | |
34 s = tc.sym.vclassinfo.toSymbol(); | |
35 dtxoff(pdt, s, 0, TYnptr); // ClassInfo for tinfo | |
36 } | |
37 } | |
38 |