您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ toPrettyChars函数代码示例

51自学网 2021-06-03 08:53:10
  C++
这篇教程C++ toPrettyChars函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中toPrettyChars函数的典型用法代码示例。如果您正苦于以下问题:C++ toPrettyChars函数的具体用法?C++ toPrettyChars怎么用?C++ toPrettyChars使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了toPrettyChars函数的23个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: locToChars

void Dsymbol::error(Loc loc, const char *format, ...){    if (!global.gag)    {        char *p = loc.toChars();        if (!*p)            p = locToChars();        if (*p)            fprintf(stdmsg, "%s: ", p);        mem.free(p);        fprintf(stdmsg, "%s %s ", kind(), toPrettyChars());        va_list ap;        va_start(ap, format);        vfprintf(stdmsg, format, ap);        va_end(ap);        fprintf(stdmsg, "/n");        fflush(stdmsg);    }    global.errors++;    //fatal();}
开发者ID:apriori,项目名称:dsss,代码行数:27,


示例2: locToChars

void Dsymbol::error(const char *format, ...){    //printf("Dsymbol::error()/n");    if (!global.gag)    {        char *p = locToChars();        if (*p)            fprintf(stdmsg, "%s: ", p);        mem.free(p);        fprintf(stdmsg, "Error: ");        if (isAnonymous())            fprintf(stdmsg, "%s ", kind());        else            fprintf(stdmsg, "%s %s ", kind(), toPrettyChars());        va_list ap;        va_start(ap, format);        vfprintf(stdmsg, format, ap);        va_end(ap);        fprintf(stdmsg, "/n");        fflush(stdmsg);    }    global.errors++;    //fatal();}
开发者ID:DinrusGroup,项目名称:DRC,代码行数:29,


示例3: va_start

void Dsymbol::error(Loc loc, const char *format, ...){    va_list ap;    va_start(ap, format);    ::verror(loc, format, ap, kind(), toPrettyChars());    va_end(ap);}
开发者ID:Nishi,项目名称:dmd,代码行数:7,


示例4: assert

void TypedefDeclaration::toDebug(){    //printf("TypedefDeclaration::toDebug('%s')/n", toChars());    assert(config.fulltypes >= CV4);    // If it is a member, it is handled by cvMember()    if (!isMember())    {        if (basetype->ty == Ttuple)            return;        const char *id = toPrettyChars();        idx_t typidx = cv4_typidx(basetype->toCtype());        if (config.fulltypes == CV8)            cv8_udt(id, typidx);        else        {            unsigned len = strlen(id);            unsigned char *debsym = (unsigned char *) alloca(39 + IDOHD + len);            // Output a 'user-defined type' for the tag name            TOWORD(debsym + 2,S_UDT);            TOIDX(debsym + 4,typidx);            unsigned length = 2 + 2 + cgcv.sz_idx;            length += cv_namestring(debsym + length,id);            TOWORD(debsym,length - 2);            assert(length <= 40 + len);            objmod->write_bytes(SegData[DEBSYM],length,debsym);        }    }}
开发者ID:John-Colvin,项目名称:dmd,代码行数:33,


示例5: locToChars

void Dsymbol::verror(Loc loc, const char *format, va_list ap){    if (!global.gag)    {        char *p = loc.toChars();        if (!*p)            p = locToChars();        if (*p)            fprintf(stdmsg, "%s: ", p);        mem.free(p);        fprintf(stdmsg, "Error: ");        fprintf(stdmsg, "%s %s ", kind(), toPrettyChars());        vfprintf(stdmsg, format, ap);        fprintf(stdmsg, "/n");        fflush(stdmsg);//halt();    }    else    {        global.gaggedErrors++;    }    global.errors++;    //fatal();}
开发者ID:olgk,项目名称:ldc,代码行数:30,


示例6: assert

void EnumDeclaration::toDebug(){    //printf("EnumDeclaration::toDebug('%s')/n", toChars());    assert(config.fulltypes >= CV4);    // If it is a member, it is handled by cvMember()    if (!isMember())    {	unsigned length;	const char *id = toPrettyChars();	idx_t typidx = cv4_Denum(this);	unsigned len = strlen(id);	unsigned char *debsym = (unsigned char *) alloca(39 + IDOHD + len);	// Output a 'user-defined type' for the tag name	TOWORD(debsym + 2,S_UDT);	TOIDX(debsym + 4,typidx);	length = 2 + 2 + cgcv.sz_idx;	length += cv_namestring(debsym + length,id);	TOWORD(debsym,length - 2);	assert(length <= 40 + len);	obj_write_bytes(SegData[DEBSYM],length,debsym);    }}
开发者ID:Geod24,项目名称:dnet,代码行数:26,


示例7: getModule

void Dsymbol::error(const char *format, ...){    //printf("Dsymbol::error()/n");    if (!loc.filename)  // avoid bug 5861.    {        Module *m = getModule();        if (m && m->srcfile)            loc.filename = m->srcfile->toChars();    }    va_list ap;    va_start(ap, format);    verror(loc, format, ap, kind(), toPrettyChars());    va_end(ap);}
开发者ID:alexrp,项目名称:ldc,代码行数:15,


示例8: printf

void FuncDeclaration::inlineScan(){    InlineScanState iss;#if LOG    printf("FuncDeclaration::inlineScan('%s')/n", toPrettyChars());#endif    memset(&iss, 0, sizeof(iss));    iss.fd = this;    if (fbody && !naked)    {        inlineNest++;        fbody = fbody->inlineScan(&iss);        inlineNest--;    }}
开发者ID:D-Programming-microD,项目名称:GDC,代码行数:16,


示例9: toPrettyChars

void Module::jsonProperties(JsonOut *json){#if 0    Dsymbol::jsonProperties(json);    if (md && md->packages)    {        json->propertyStart("package");        json->arrayStart();        for (size_t i = 0; i < md->packages->dim; i++)        {   Identifier *pid = (*md->packages)[i];            json->item(pid->toChars());        }        json->arrayEnd();    }    json->property("prettyName", toPrettyChars());#endif}
开发者ID:1100110,项目名称:dmd,代码行数:19,


示例10: assert

Symbol *VarDeclaration::toSymbol(){    //printf("VarDeclaration::toSymbol(%s)/n", toChars());    //if (needThis()) *(char*)0=0;    assert(!needThis());    if (!csym)    {        TYPE *t;        const char *id;        if (isDataseg())            id = mangle();        else            id = ident->toChars();        Symbol *s = symbol_calloc(id);        s->Salignment = alignment;        if (storage_class & (STCout | STCref))        {            // should be TYref, but problems in back end            t = type_pointer(type->toCtype());        }        else if (storage_class & STClazy)        {            if (config.exe == EX_WIN64 && isParameter())                t = type_fake(TYnptr);            else                t = type_fake(TYdelegate);          // Tdelegate as C type            t->Tcount++;        }        else if (isParameter())        {            if (config.exe == EX_WIN64 && type->size(Loc()) > REGSIZE)            {                // should be TYref, but problems in back end                t = type_pointer(type->toCtype());            }            else            {                t = type->toCParamtype();                t->Tcount++;            }        }        else        {            t = type->toCtype();            t->Tcount++;        }        if (isDataseg())        {            if (isThreadlocal())            {   /* Thread local storage                 */                TYPE *ts = t;                ts->Tcount++;   // make sure a different t is allocated                type_setty(&t, t->Tty | mTYthread);                ts->Tcount--;                if (global.params.vtls)                {                    char *p = loc.toChars();                    fprintf(stderr, "%s: %s is thread local/n", p ? p : "", toChars());                    if (p)                        mem.free(p);                }            }            s->Sclass = SCextern;            s->Sfl = FLextern;            slist_add(s);            /* if it's global or static, then it needs to have a qualified but unmangled name.             * This gives some explanation of the separation in treating name mangling.             * It applies to PDB format, but should apply to CV as PDB derives from CV.             *    http://msdn.microsoft.com/en-us/library/ff553493(VS.85).aspx             */            s->prettyIdent = toPrettyChars();        }        else        {            s->Sclass = SCauto;            s->Sfl = FLauto;            if (nestedrefs.dim)            {                /* Symbol is accessed by a nested function. Make sure                 * it is not put in a register, and that the optimizer                 * assumes it is modified across function calls and pointer                 * dereferences.                 */                //printf("/tnested ref, not register/n");                type_setcv(&t, t->Tty | mTYvolatile);            }        }        if (ident == Id::va_argsave)            /* __va_argsave is set outside of the realm of the optimizer,             * so we tell the optimizer to leave it alone             */            type_setcv(&t, t->Tty | mTYvolatile);//.........这里部分代码省略.........
开发者ID:andralex,项目名称:dmd,代码行数:101,


示例11: error

//.........这里部分代码省略.........                    goto Lutf16;                }                else if (buf[0] == 0)                {   // UTF-16BE                    le = 0;                    goto Lutf16;                }            }            // It's UTF-8            if (buf[0] >= 0x80)            {   error("source file must start with BOM or ASCII character, not //x%02X", buf[0]);                fatal();            }        }    }#ifdef IN_GCC    // dump utf-8 encoded source    if (global.params.dump_source)    {   // %% srcname could contain a path ...        d_gcc_dump_source(srcname, "utf-8", buf, buflen);    }#endif    /* If it starts with the string "Ddoc", then it's a documentation     * source file.     */    if (buflen >= 4 && memcmp(buf, "Ddoc", 4) == 0)    {        comment = buf + 4;        isDocFile = 1;        if (!docfile)            setDocfile();        return;    }    Parser p(this, buf, buflen, docfile != NULL);    p.nextToken();    members = p.parseModule();    if (srcfile->ref == 0)        ::free(srcfile->buffer);    srcfile->buffer = NULL;    srcfile->len = 0;    md = p.md;    numlines = p.loc.linnum;    DsymbolTable *dst;    if (md)    {   this->ident = md->id;        this->safe = md->safe;        Package *ppack = NULL;        dst = Package::resolve(md->packages, &this->parent, &ppack);        if (ppack && ppack->isModule())        {            error(loc, "package name '%s' in file %s conflicts with usage as a module name in file %s",                ppack->toChars(), srcname, ppack->isModule()->srcfile->toChars());            dst = modules;        }    }    else    {        dst = modules;        /* Check to see if module name is a valid identifier         */        if (!Lexer::isValidIdentifier(this->ident->toChars()))            error("has non-identifier characters in filename, use module declaration instead");    }    // Update global list of modules    if (!dst->insert(this))    {        Dsymbol *prev = dst->lookup(ident);        assert(prev);        Module *mprev = prev->isModule();        if (mprev)        {            if (strcmp(srcname, mprev->srcfile->toChars()) == 0)                error(loc, "from file %s must be imported as module '%s'",                    srcname, toPrettyChars());            else                error(loc, "from file %s conflicts with another module %s from file %s",                    srcname, mprev->toChars(), mprev->srcfile->toChars());        }        else        {            Package *pkg = prev->isPackage();            assert(pkg);            error(pkg->loc, "from file %s conflicts with package name %s",                srcname, pkg->toChars());        }    }    else    {        amodules.push(this);    }}
开发者ID:OpenFlex,项目名称:dmd,代码行数:101,


示例12: toPrettyChars

void Module::genobjfile(bool multiobj){    //EEcontext *ee = env->getEEcontext();    //printf("Module::genobjfile(multiobj = %d) %s/n", multiobj, toChars());    if (ident == Id::entrypoint)    {        bool v = global.params.verbose;        global.params.verbose = false;        for (size_t i = 0; i < members->dim; i++)        {            Dsymbol *member = (*members)[i];            //printf("toObjFile %s %s/n", member->kind(), member->toChars());            member->toObjFile(global.params.multiobj);        }        global.params.verbose = v;        return;    }    lastmname = srcfile->toChars();    objmod->initfile(lastmname, NULL, toPrettyChars());    eictor = NULL;    ictorlocalgot = NULL;    sctors.setDim(0);    ectorgates.setDim(0);    sdtors.setDim(0);    ssharedctors.setDim(0);    esharedctorgates.setDim(0);    sshareddtors.setDim(0);    stests.setDim(0);    dtorcount = 0;    shareddtorcount = 0;    if (doppelganger)    {        /* Generate a reference to the moduleinfo, so the module constructors         * and destructors get linked in.         */        Module *m = aimports[0];        assert(m);        if (m->sictor || m->sctor || m->sdtor || m->ssharedctor || m->sshareddtor)        {            Symbol *s = toSymbol(m);            //objextern(s);            //if (!s->Sxtrnnum) objextdef(s->Sident);            if (!s->Sxtrnnum)            {                //printf("%s/n", s->Sident);#if 0 /* This should work, but causes optlink to fail in common/newlib.asm */                objextdef(s->Sident);#else                Symbol *sref = symbol_generate(SCstatic, type_fake(TYnptr));                sref->Sfl = FLdata;                dtxoff(&sref->Sdt, s, 0, TYnptr);                outdata(sref);#endif            }        }    }    if (global.params.cov)    {        /* Create coverage identifier:         *  private uint[numlines] __coverage;         */        cov = symbol_calloc("__coverage");        cov->Stype = type_fake(TYint);        cov->Stype->Tmangle = mTYman_c;        cov->Stype->Tcount++;        cov->Sclass = SCstatic;        cov->Sfl = FLdata;        dtnzeros(&cov->Sdt, 4 * numlines);        outdata(cov);        slist_add(cov);        covb = (unsigned *)calloc((numlines + 32) / 32, sizeof(*covb));    }    for (size_t i = 0; i < members->dim; i++)    {        Dsymbol *member = (*members)[i];        //printf("toObjFile %s %s/n", member->kind(), member->toChars());        member->toObjFile(multiobj);    }    if (global.params.cov)    {        /* Generate         *      bit[numlines] __bcoverage;         */        Symbol *bcov = symbol_calloc("__bcoverage");        bcov->Stype = type_fake(TYuint);        bcov->Stype->Tcount++;        bcov->Sclass = SCstatic;        bcov->Sfl = FLdata;//.........这里部分代码省略.........
开发者ID:abhishekkumar-,项目名称:dmd,代码行数:101,


示例13: ObjectNotFound

//.........这里部分代码省略.........    // These must match the values in druntime/src/object_.d#define MIstandalone      0x4#define MItlsctor         0x8#define MItlsdtor         0x10#define MIctor            0x20#define MIdtor            0x40#define MIxgetMembers     0x80#define MIictor           0x100#define MIunitTest        0x200#define MIimportedModules 0x400#define MIlocalClasses    0x800#define MIname            0x1000    unsigned flags = 0;    if (!needmoduleinfo)        flags |= MIstandalone;    if (sctor)        flags |= MItlsctor;    if (sdtor)        flags |= MItlsdtor;    if (ssharedctor)        flags |= MIctor;    if (sshareddtor)        flags |= MIdtor;    if (sgetmembers)        flags |= MIxgetMembers;    if (sictor)        flags |= MIictor;    if (stest)        flags |= MIunitTest;    if (aimports_dim)        flags |= MIimportedModules;    if (aclasses.dim)        flags |= MIlocalClasses;    flags |= MIname;    dtdword(&dt, flags);        // _flags    dtdword(&dt, 0);            // _index    if (flags & MItlsctor)        dtxoff(&dt, sctor, 0, TYnptr);    if (flags & MItlsdtor)        dtxoff(&dt, sdtor, 0, TYnptr);    if (flags & MIctor)        dtxoff(&dt, ssharedctor, 0, TYnptr);    if (flags & MIdtor)        dtxoff(&dt, sshareddtor, 0, TYnptr);    if (flags & MIxgetMembers)        dtxoff(&dt, toSymbol(sgetmembers), 0, TYnptr);    if (flags & MIictor)        dtxoff(&dt, sictor, 0, TYnptr);    if (flags & MIunitTest)        dtxoff(&dt, stest, 0, TYnptr);    if (flags & MIimportedModules)    {        dtsize_t(&dt, aimports_dim);        for (size_t i = 0; i < aimports.dim; i++)        {   Module *m = aimports[i];            if (m->needmoduleinfo)            {                Symbol *s = toSymbol(m);                /* Weak references don't pull objects in from the library,                 * they resolve to 0 if not pulled in by something else.                 * Don't pull in a module just because it was imported.                 */                s->Sflags |= SFLweak;                dtxoff(&dt, s, 0, TYnptr);            }        }    }    if (flags & MIlocalClasses)    {        dtsize_t(&dt, aclasses.dim);        for (size_t i = 0; i < aclasses.dim; i++)        {            ClassDeclaration *cd = aclasses[i];            dtxoff(&dt, toSymbol(cd), 0, TYnptr);        }    }    if (flags & MIname)    {        // Put out module name as a 0-terminated string, to save bytes        nameoffset = dt_size(dt);        const char *name = toPrettyChars();        namelen = strlen(name);        dtnbytes(&dt, namelen + 1, name);        //printf("nameoffset = x%x/n", nameoffset);    }    csym->Sdt = dt;    // Cannot be CONST because the startup code sets flag bits in it    outdata(csym);    //////////////////////////////////////////////    objmod->moduleinfo(msym);}
开发者ID:mnembrini,项目名称:dmd,代码行数:101,


示例14: toChars

llvm::Module* Module::genLLVMModule(llvm::LLVMContext& context){    bool logenabled = Logger::enabled();    if (llvmForceLogging && !logenabled)    {        Logger::enable();    }    IF_LOG Logger::println("Generating module: %s", (md ? md->toChars() : toChars()));    LOG_SCOPE;    if (global.params.verbose_cg)        printf("codegen: %s (%s)/n", toPrettyChars(), srcfile->toChars());    if (global.errors)    {        Logger::println("Aborting because of errors");        fatal();    }    // name the module#if 1    // Temporary workaround for http://llvm.org/bugs/show_bug.cgi?id=11479 
C++ toQString函数代码示例
C++ toObject函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。