本文整理汇总了C++中DtBuilder::isZeroLength方法的典型用法代码示例。如果您正苦于以下问题:C++ DtBuilder::isZeroLength方法的具体用法?C++ DtBuilder::isZeroLength怎么用?C++ DtBuilder::isZeroLength使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DtBuilder
的用法示例。
在下文中一共展示了DtBuilder::isZeroLength方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: visit
//.........这里部分代码省略.........
offset -= fd->interfaceVirtual->offset;
}
dtb.xoff(toThunkSymbol(fd, offset), 0, TYnptr);
}
else
dtb.size(0);
offset += Target::ptrsize;
}
}
}
}
//////////////////////////////////////////////
dtpatchoffset(pdtname, offset);
dtb.nbytes(namelen + 1, name);
const size_t namepad = -(namelen + 1) & (Target::ptrsize - 1); // align
dtb.nzeros(namepad);
cd->csym->Sdt = dtb.finish();
// ClassInfo cannot be const data, because we use the monitor on it
outdata(cd->csym);
if (cd->isExport())
objmod->export_symbol(cd->csym, 0);
//////////////////////////////////////////////
// Put out the vtbl[]
//printf("putting out %s.vtbl[]\n", toChars());
DtBuilder dtbv;
if (cd->vtblOffset())
dtbv.xoff(cd->csym, 0, TYnptr); // first entry is ClassInfo reference
for (size_t i = cd->vtblOffset(); i < cd->vtbl.dim; i++)
{
FuncDeclaration *fd = cd->vtbl[i]->isFuncDeclaration();
//printf("\tvtbl[%d] = %p\n", i, fd);
if (fd && (fd->fbody || !cd->isAbstract()))
{
// Ensure function has a return value (Bugzilla 4869)
fd->functionSemantic();
Symbol *s = toSymbol(fd);
if (cd->isFuncHidden(fd))
{
/* fd is hidden from the view of this class.
* If fd overlaps with any function in the vtbl[], then
* issue 'hidden' error.
*/
for (size_t j = 1; j < cd->vtbl.dim; j++)
{
if (j == i)
continue;
FuncDeclaration *fd2 = cd->vtbl[j]->isFuncDeclaration();
if (!fd2->ident->equals(fd->ident))
continue;
if (fd->leastAsSpecialized(fd2) || fd2->leastAsSpecialized(fd))
{
TypeFunction *tf = (TypeFunction *)fd->type;
if (tf->ty == Tfunction)
{
cd->error("use of %s%s is hidden by %s; use 'alias %s = %s.%s;' to introduce base class overload set",
fd->toPrettyChars(),
parametersTypeToChars(tf->parameters, tf->varargs),
cd->toChars(),
fd->toChars(),
fd->parent->toChars(),
fd->toChars());
}
else
cd->error("use of %s is hidden by %s", fd->toPrettyChars(), cd->toChars());
break;
}
}
}
dtbv.xoff(s, 0, TYnptr);
}
else
dtbv.size(0);
}
if (dtbv.isZeroLength())
{
/* Someone made an 'extern (C++) class C { }' with no virtual functions.
* But making an empty vtbl[] causes linking problems, so make a dummy
* entry.
*/
dtbv.size(0);
}
cd->vtblsym->Sdt = dtbv.finish();
cd->vtblsym->Sclass = scclass;
cd->vtblsym->Sfl = FLdata;
out_readonly(cd->vtblsym);
outdata(cd->vtblsym);
if (cd->isExport())
objmod->export_symbol(cd->vtblsym,0);
}