Mercurial > projects > ddmd
diff dmd/TypeInfoInterfaceDeclaration.d @ 0:10317f0c89a5
Initial commit
author | korDen |
---|---|
date | Sat, 24 Oct 2009 08:42:06 +0400 |
parents | |
children | 2e2a5c3f943a |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dmd/TypeInfoInterfaceDeclaration.d Sat Oct 24 08:42:06 2009 +0400 @@ -0,0 +1,38 @@ +module dmd.TypeInfoInterfaceDeclaration; + +import dmd.Type; +import dmd.TypeInfoDeclaration; +import dmd.ClassInfoDeclaration; +import dmd.TypeClass; +import dmd.TY; + +import dmd.backend.dt_t; +import dmd.backend.Symbol; +import dmd.backend.Util; +import dmd.backend.TYM; + +class TypeInfoInterfaceDeclaration : TypeInfoDeclaration +{ + this(Type tinfo) + { + super(tinfo, 0); + } + + void toDt(dt_t** pdt) + { + //printf("TypeInfoInterfaceDeclaration.toDt() %s\n", tinfo.toChars()); + dtxoff(pdt, Type.typeinfointerface.toVtblSymbol(), 0, TYnptr); // vtbl for TypeInfoInterface + dtdword(pdt, 0); // monitor + + assert(tinfo.ty == Tclass); + + TypeClass tc = cast(TypeClass)tinfo; + Symbol *s; + + if (!tc.sym.vclassinfo) + tc.sym.vclassinfo = new ClassInfoDeclaration(tc.sym); + s = tc.sym.vclassinfo.toSymbol(); + dtxoff(pdt, s, 0, TYnptr); // ClassInfo for tinfo + } +} +