Fixed all issues preventing Tango 0.99.8 to compile with `sh build-tango.sh --verbose ldc'.

This commit is contained in:
Tomas Lindquist Olsen
2009-04-17 14:38:29 +02:00
parent f5ce8eda1d
commit 1c79df3817
8 changed files with 72 additions and 18 deletions

View File

@@ -109,9 +109,7 @@ void IrTypeClass::addBaseClassData(
offset += PTRSIZE;
// add to the interface map
// FIXME: and all it's baseinterfaces
if (interfaceMap.find(b->base) == interfaceMap.end())
interfaceMap.insert(std::make_pair(b->base, field_index));
addInterfaceToMap(b->base, field_index);
field_index++;
// inc count
@@ -252,3 +250,22 @@ size_t IrTypeClass::getInterfaceIndex(ClassDeclaration * inter)
}
//////////////////////////////////////////////////////////////////////////////
void IrTypeClass::addInterfaceToMap(ClassDeclaration * inter, size_t index)
{
// don't duplicate work or overwrite indices
if (interfaceMap.find(inter) != interfaceMap.end())
return;
// add this interface
interfaceMap.insert(std::make_pair(inter, index));
// add all its base interfaces recursively
for (size_t i = 0; i < inter->interfaces_dim; i++)
{
BaseClass* b = inter->interfaces[i];
addInterfaceToMap(b->base, index);
}
}
//////////////////////////////////////////////////////////////////////////////