From 40fa7653e248d07bb971d3ea64bef83f2222f25b Mon Sep 17 00:00:00 2001 From: Alexey Prokhin Date: Tue, 1 Nov 2011 12:07:59 +0400 Subject: [PATCH] Sync TypeInfoClass flags with dmd --- gen/classes.cpp | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/gen/classes.cpp b/gen/classes.cpp index 96c4a990..0e1e871a 100644 --- a/gen/classes.cpp +++ b/gen/classes.cpp @@ -626,24 +626,26 @@ static unsigned build_classinfo_flags(ClassDeclaration* cd) { // adapted from original dmd code unsigned flags = 0; - //flags |= isCOMclass(); // IUnknown + flags |= cd->isCOMclass(); // IUnknown 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) { - if (cd2->members) - { + if (!cd2->members) + continue; for (size_t i = 0; i < cd2->members->dim; i++) { - Dsymbol *sm = (Dsymbol *)cd2->members->data[i]; - if (sm->isVarDeclaration() && !sm->isVarDeclaration()->isDataseg()) // is this enough? - hasOffTi = true; - //printf("sm = %s %s\n", sm->kind(), sm->toChars()); - if (sm->hasPointers()) - goto L2; + Dsymbol *sm = (Dsymbol *)cd2->members->data[i]; + if (sm->isVarDeclaration() && !sm->isVarDeclaration()->isDataseg()) // is this enough? + hasOffTi = true; + //printf("sm = %s %s\n", sm->kind(), sm->toChars()); + if (sm->hasPointers()) + goto L2; } } - } flags |= 2; // no pointers L2: if (hasOffTi) @@ -760,7 +762,7 @@ LLConstant* DtoDefineClassInfo(ClassDeclaration* cd) // uint flags if (cd->isInterfaceDeclaration()) - b.push_uint(0); + b.push_uint(4 | cd->isCOMinterface() | 32); else b.push_uint(build_classinfo_flags(cd));