mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-07-29 02:20:04 +02:00
Sync TypeInfoClass flags with dmd
This commit is contained in:
@@ -626,24 +626,26 @@ static unsigned build_classinfo_flags(ClassDeclaration* cd)
|
|||||||
{
|
{
|
||||||
// adapted from original dmd code
|
// adapted from original dmd code
|
||||||
unsigned flags = 0;
|
unsigned flags = 0;
|
||||||
//flags |= isCOMclass(); // IUnknown
|
flags |= cd->isCOMclass(); // IUnknown
|
||||||
bool hasOffTi = false;
|
bool hasOffTi = false;
|
||||||
if (cd->ctor) flags |= 8;
|
if (cd->ctor)
|
||||||
|
flags |= 8;
|
||||||
|
if (cd->isabstract)
|
||||||
|
flags |= 64;
|
||||||
for (ClassDeclaration *cd2 = cd; cd2; cd2 = cd2->baseClass)
|
for (ClassDeclaration *cd2 = cd; cd2; cd2 = cd2->baseClass)
|
||||||
{
|
{
|
||||||
if (cd2->members)
|
if (!cd2->members)
|
||||||
{
|
continue;
|
||||||
for (size_t i = 0; i < cd2->members->dim; i++)
|
for (size_t i = 0; i < cd2->members->dim; i++)
|
||||||
{
|
{
|
||||||
Dsymbol *sm = (Dsymbol *)cd2->members->data[i];
|
Dsymbol *sm = (Dsymbol *)cd2->members->data[i];
|
||||||
if (sm->isVarDeclaration() && !sm->isVarDeclaration()->isDataseg()) // is this enough?
|
if (sm->isVarDeclaration() && !sm->isVarDeclaration()->isDataseg()) // is this enough?
|
||||||
hasOffTi = true;
|
hasOffTi = true;
|
||||||
//printf("sm = %s %s\n", sm->kind(), sm->toChars());
|
//printf("sm = %s %s\n", sm->kind(), sm->toChars());
|
||||||
if (sm->hasPointers())
|
if (sm->hasPointers())
|
||||||
goto L2;
|
goto L2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
flags |= 2; // no pointers
|
flags |= 2; // no pointers
|
||||||
L2:
|
L2:
|
||||||
if (hasOffTi)
|
if (hasOffTi)
|
||||||
@@ -760,7 +762,7 @@ LLConstant* DtoDefineClassInfo(ClassDeclaration* cd)
|
|||||||
|
|
||||||
// uint flags
|
// uint flags
|
||||||
if (cd->isInterfaceDeclaration())
|
if (cd->isInterfaceDeclaration())
|
||||||
b.push_uint(0);
|
b.push_uint(4 | cd->isCOMinterface() | 32);
|
||||||
else
|
else
|
||||||
b.push_uint(build_classinfo_flags(cd));
|
b.push_uint(build_classinfo_flags(cd));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user