mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-02-19 05:03:13 +01:00
Fixed classinfo.interfaces for .. interfaces!
This commit is contained in:
@@ -424,11 +424,20 @@ LLConstant * IrStruct::getClassInfoInterfaces()
|
||||
ci = DtoBitCast(ci, classinfo_type);
|
||||
|
||||
// vtbl
|
||||
ClassGlobalMap::iterator itv = interfaceVtblMap.find(it->base);
|
||||
assert(itv != interfaceVtblMap.end() && "interface vtbl not found");
|
||||
LLConstant* vtb = itv->second;
|
||||
vtb = DtoBitCast(vtb, voidptrptr_type);
|
||||
vtb = DtoConstSlice(DtoConstSize_t(itc->getVtblSize()), vtb);
|
||||
LLConstant* vtb;
|
||||
// interface get a null
|
||||
if (cd->isInterfaceDeclaration())
|
||||
{
|
||||
vtb = DtoConstSlice(DtoConstSize_t(0), getNullValue(voidptrptr_type));
|
||||
}
|
||||
else
|
||||
{
|
||||
ClassGlobalMap::iterator itv = interfaceVtblMap.find(it->base);
|
||||
assert(itv != interfaceVtblMap.end() && "interface vtbl not found");
|
||||
vtb = itv->second;
|
||||
vtb = DtoBitCast(vtb, voidptrptr_type);
|
||||
vtb = DtoConstSlice(DtoConstSize_t(itc->getVtblSize()), vtb);
|
||||
}
|
||||
|
||||
// offset
|
||||
LLConstant* off = DtoConstSize_t(it->offset);
|
||||
@@ -473,3 +482,22 @@ LLConstant * IrStruct::getClassInfoInterfaces()
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void IrStruct::initializeInterface()
|
||||
{
|
||||
InterfaceDeclaration* base = aggrdecl->isInterfaceDeclaration();
|
||||
assert(base && "not interface");
|
||||
|
||||
// has interface vtbls?
|
||||
if (!base->vtblInterfaces)
|
||||
return;
|
||||
|
||||
ArrayIter<BaseClass> it(*base->vtblInterfaces);
|
||||
for (; !it.done(); it.next())
|
||||
{
|
||||
// add to the interface list
|
||||
interfacesWithVtbls.push_back(it.get());
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Reference in New Issue
Block a user