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


C++ StringTable::update方法代码示例

本文整理汇总了C++中StringTable::update方法的典型用法代码示例。如果您正苦于以下问题:C++ StringTable::update方法的具体用法?C++ StringTable::update怎么用?C++ StringTable::update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在StringTable的用法示例。


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

示例1: ErrorExp

Expression *BinExp::arrayOp(Scope *sc)
{
    //printf("BinExp::arrayOp() %s\n", toChars());

    if (type->toBasetype()->nextOf()->toBasetype()->ty == Tvoid)
    {
        error("Cannot perform array operations on void[] arrays");
        return new ErrorExp();
    }

    Expressions *arguments = new Expressions();

    /* The expression to generate an array operation for is mangled
     * into a name to use as the array operation function name.
     * Mangle in the operands and operators in RPN order, and type.
     */
    OutBuffer buf;
    buf.writestring("_array");
    buildArrayIdent(&buf, arguments);
    buf.writeByte('_');

    /* Append deco of array element type
     */
#if DMDV2
    buf.writestring(type->toBasetype()->nextOf()->toBasetype()->mutableOf()->deco);
#else
    buf.writestring(type->toBasetype()->nextOf()->toBasetype()->deco);
#endif

    size_t namelen = buf.offset;
    buf.writeByte(0);
    char *name = (char *)buf.extractData();

    /* Look up name in hash table
     */
    StringValue *sv = arrayfuncs.update(name, namelen);
    FuncDeclaration *fd = (FuncDeclaration *)sv->ptrvalue;
    if (!fd)
    {
	/* Some of the array op functions are written as library functions,
	 * presumably to optimize them with special CPU vector instructions.
	 * List those library functions here, in alpha order.
	 */
	static const char *libArrayopFuncs[] =
	{
	    "_arrayExpSliceAddass_a",
	    "_arrayExpSliceAddass_d",		// T[]+=T
	    "_arrayExpSliceAddass_f",		// T[]+=T
	    "_arrayExpSliceAddass_g",
	    "_arrayExpSliceAddass_h",
	    "_arrayExpSliceAddass_i",
	    "_arrayExpSliceAddass_k",
	    "_arrayExpSliceAddass_s",
	    "_arrayExpSliceAddass_t",
	    "_arrayExpSliceAddass_u",
	    "_arrayExpSliceAddass_w",

	    "_arrayExpSliceDivass_d",		// T[]/=T
	    "_arrayExpSliceDivass_f",		// T[]/=T

	    "_arrayExpSliceMinSliceAssign_a",
	    "_arrayExpSliceMinSliceAssign_d",	// T[]=T-T[]
	    "_arrayExpSliceMinSliceAssign_f",	// T[]=T-T[]
	    "_arrayExpSliceMinSliceAssign_g",
	    "_arrayExpSliceMinSliceAssign_h",
	    "_arrayExpSliceMinSliceAssign_i",
	    "_arrayExpSliceMinSliceAssign_k",
	    "_arrayExpSliceMinSliceAssign_s",
	    "_arrayExpSliceMinSliceAssign_t",
	    "_arrayExpSliceMinSliceAssign_u",
	    "_arrayExpSliceMinSliceAssign_w",

	    "_arrayExpSliceMinass_a",
	    "_arrayExpSliceMinass_d",		// T[]-=T
	    "_arrayExpSliceMinass_f",		// T[]-=T
	    "_arrayExpSliceMinass_g",
	    "_arrayExpSliceMinass_h",
	    "_arrayExpSliceMinass_i",
	    "_arrayExpSliceMinass_k",
	    "_arrayExpSliceMinass_s",
	    "_arrayExpSliceMinass_t",
	    "_arrayExpSliceMinass_u",
	    "_arrayExpSliceMinass_w",

	    "_arrayExpSliceMulass_d",		// T[]*=T
	    "_arrayExpSliceMulass_f",		// T[]*=T
	    "_arrayExpSliceMulass_i",
	    "_arrayExpSliceMulass_k",
	    "_arrayExpSliceMulass_s",
	    "_arrayExpSliceMulass_t",
	    "_arrayExpSliceMulass_u",
	    "_arrayExpSliceMulass_w",

	    "_arraySliceExpAddSliceAssign_a",
	    "_arraySliceExpAddSliceAssign_d",	// T[]=T[]+T
	    "_arraySliceExpAddSliceAssign_f",	// T[]=T[]+T
	    "_arraySliceExpAddSliceAssign_g",
	    "_arraySliceExpAddSliceAssign_h",
	    "_arraySliceExpAddSliceAssign_i",
	    "_arraySliceExpAddSliceAssign_k",
//.........这里部分代码省略.........
开发者ID:Geod24,项目名称:dnet,代码行数:101,代码来源:arrayop.c


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