本文整理汇总了C++中Dsymbol::hasPointers方法的典型用法代码示例。如果您正苦于以下问题:C++ Dsymbol::hasPointers方法的具体用法?C++ Dsymbol::hasPointers怎么用?C++ Dsymbol::hasPointers使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dsymbol
的用法示例。
在下文中一共展示了Dsymbol::hasPointers方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: build_classinfo_flags
static unsigned build_classinfo_flags(ClassDeclaration* cd)
{
// adapted from original dmd code
unsigned flags = 0;
flags |= cd->isCOMclass(); // IUnknown
bool hasOffTi = false;
if (cd->ctor)
flags |= 8;
if (cd->isabstract)
flags |= 64;
for (ClassDeclaration *cd2 = cd; cd2; cd2 = cd2->baseClass)
{
if (!cd2->members)
continue;
for (size_t i = 0; i < cd2->members->dim; i++)
{
Dsymbol *sm = static_cast<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)
flags |= 4;
// always define the typeinfo field.
// why would ever not do this?
flags |= 32;
return flags;
}
示例2: hasPointers
bool AttribDeclaration::hasPointers()
{
Dsymbols *d = include(NULL, NULL);
if (d)
{
for (size_t i = 0; i < d->dim; i++)
{
Dsymbol *s = (*d)[i];
if (s->hasPointers())
return true;
}
}
return false;
}
示例3: hasPointers
int AttribDeclaration::hasPointers()
{
Array *d = include(NULL, NULL);
if (d)
{
for (size_t i = 0; i < d->dim; i++)
{
Dsymbol *s = (Dsymbol *)d->data[i];
if (s->hasPointers())
return 1;
}
}
return 0;
}
示例4: hasPointers
bool Nspace::hasPointers()
{
//printf("Nspace::hasPointers() %s\n", toChars());
if (members)
{
for (size_t i = 0; i < members->dim; i++)
{
Dsymbol *s = (*members)[i];
//printf(" s = %s %s\n", s->kind(), s->toChars());
if (s->hasPointers())
{
return true;
}
}
}
return false;
}
示例5: visit
//.........这里部分代码省略.........
// invariant
if (cd->inv)
dtxoff(&dt, toSymbol(cd->inv), 0, TYnptr);
else
dtsize_t(&dt, 0);
// flags
ClassFlags::Type flags = ClassFlags::hasOffTi;
if (cd->isCOMclass()) flags |= ClassFlags::isCOMclass;
if (cd->isCPPclass()) flags |= ClassFlags::isCPPclass;
flags |= ClassFlags::hasGetMembers;
flags |= ClassFlags::hasTypeInfo;
if (cd->ctor)
flags |= ClassFlags::hasCtor;
for (ClassDeclaration *pc = cd; pc; pc = pc->baseClass)
{
if (pc->dtor)
{
flags |= ClassFlags::hasDtor;
break;
}
}
if (cd->isabstract)
flags |= ClassFlags::isAbstract;
for (ClassDeclaration *pc = cd; pc; pc = pc->baseClass)
{
if (pc->members)
{
for (size_t i = 0; i < pc->members->dim; i++)
{
Dsymbol *sm = (*pc->members)[i];
//printf("sm = %s %s\n", sm->kind(), sm->toChars());
if (sm->hasPointers())
goto L2;
}
}
}
flags |= ClassFlags::noPointers;
L2:
dtsize_t(&dt, flags);
// deallocator
if (cd->aggDelete)
dtxoff(&dt, toSymbol(cd->aggDelete), 0, TYnptr);
else
dtsize_t(&dt, 0);
// offTi[]
dtsize_t(&dt, 0);
dtsize_t(&dt, 0); // null for now, fix later
// defaultConstructor
if (cd->defaultCtor && !(cd->defaultCtor->storage_class & STCdisable))
dtxoff(&dt, toSymbol(cd->defaultCtor), 0, TYnptr);
else
dtsize_t(&dt, 0);
// xgetRTInfo
if (cd->getRTInfo)
Expression_toDt(cd->getRTInfo, &dt);
else if (flags & ClassFlags::noPointers)
dtsize_t(&dt, 0);
else
dtsize_t(&dt, 1);