Beispiel #1
0
void TypeInfoAssociativeArrayDeclaration::toDt(dt_t **pdt)
{
    //printf("TypeInfoAssociativeArrayDeclaration::toDt()\n");
#if DMDV2
    verifyStructSize(Type::typeinfoassociativearray, 5 * Target::ptrsize);
#else
    verifyStructSize(Type::typeinfoassociativearray, 4 * Target::ptrsize);
#endif

    dtxoff(pdt, Type::typeinfoassociativearray->toVtblSymbol(), 0); // vtbl for TypeInfo_AssociativeArray
    dtsize_t(pdt, 0);                        // monitor

    assert(tinfo->ty == Taarray);

    TypeAArray *tc = (TypeAArray *)tinfo;

    tc->next->getTypeInfo(NULL);
    dtxoff(pdt, tc->next->vtinfo->toSymbol(), 0); // TypeInfo for array of type

    tc->index->getTypeInfo(NULL);
    dtxoff(pdt, tc->index->vtinfo->toSymbol(), 0); // TypeInfo for array of type

#if DMDV2
    tc->getImpl()->type->getTypeInfo(NULL);
    dtxoff(pdt, tc->getImpl()->type->vtinfo->toSymbol(), 0);    // impl
#endif
}
Beispiel #2
0
void TypeInfoAssociativeArrayDeclaration::semantic3(Scope* sc)
{
    sc = sc ? sc : deferredScope;
    TypeAArray *tc = (TypeAArray *)tinfo;

    tc->next->getTypeInfo(sc);
    tc->index->getTypeInfo(sc);
#if DMDV2
    tc->getImpl()->type->getTypeInfo(sc);
#endif
}
Beispiel #3
0
void TypeInfoAssociativeArrayDeclaration::llvmDefine()
{
    Logger::println("TypeInfoAssociativeArrayDeclaration::llvmDefine() %s", toChars());
    LOG_SCOPE;

    assert(tinfo->ty == Taarray);
    TypeAArray *tc = static_cast<TypeAArray *>(tinfo);

    RTTIBuilder b(Type::typeinfoassociativearray);

    // value typeinfo
    b.push_typeinfo(tc->nextOf());

    // key typeinfo
    b.push_typeinfo(tc->index);

#if DMDV2
    // impl typeinfo
    b.push_typeinfo(tc->getImpl()->type);
#endif

    // finish
    b.finalize(ir.irGlobal);
}