当前位置: 首页>>代码示例>>C++>>正文


C++ Dsymbol::hasPointers方法代码示例

本文整理汇总了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;
}
开发者ID:NilsBossung,项目名称:ldc,代码行数:35,代码来源:classes.cpp

示例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;
}
开发者ID:doniexun,项目名称:ldc,代码行数:15,代码来源:attrib.c

示例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;
}
开发者ID:smunix,项目名称:ldc,代码行数:15,代码来源:attrib.c

示例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;
}
开发者ID:gcc-mirror,项目名称:gcc,代码行数:18,代码来源:nspace.c

示例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);
开发者ID:CodeAlchemist-T,项目名称:dmd,代码行数:67,代码来源:toobj.c


注:本文中的Dsymbol::hasPointers方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。