Mercurial > projects > ddmd
view dmd/TypeInfoTupleDeclaration.d @ 114:e28b18c23469
added a module dmd.common for commonly used stuff
it currently holds code for consistency checking of predefined versions
also added a VisualD project file
author | Trass3r |
---|---|
date | Wed, 01 Sep 2010 18:21:58 +0200 |
parents | ef02e2e203c2 |
children | 1765f3ef917d |
line wrap: on
line source
module dmd.TypeInfoTupleDeclaration; import dmd.common; import dmd.Type; import dmd.TypeInfoDeclaration; import dmd.WANT; import dmd.TypeTuple; import dmd.Argument; import dmd.Expression; import dmd.TY; import dmd.backend.TYM; import dmd.backend.Symbol; import dmd.backend.dt_t; import dmd.backend.Util; import dmd.codegen.Util; class TypeInfoTupleDeclaration : TypeInfoDeclaration { this(Type tinfo) { super(tinfo, 0); type = Type.typeinfotypelist.type; } override void toDt(dt_t **pdt) { //printf("TypeInfoTupleDeclaration.toDt() %s\n", tinfo.toChars()); dtxoff(pdt, Type.typeinfotypelist.toVtblSymbol(), 0, TYnptr); // vtbl for TypeInfoInterface dtdword(pdt, 0); // monitor assert(tinfo.ty == Ttuple); TypeTuple tu = cast(TypeTuple)tinfo; size_t dim = tu.arguments.dim; dtdword(pdt, dim); // elements.length dt_t* d = null; for (size_t i = 0; i < dim; i++) { Argument arg = cast(Argument)tu.arguments.data[i]; Expression e = arg.type.getTypeInfo(null); e = e.optimize(WANTvalue); e.toDt(&d); } Symbol *s; s = static_sym(); s.Sdt = d; outdata(s); dtxoff(pdt, s, 0, TYnptr); // elements.ptr } }