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


C++ MapInfo::isCodeGenerated方法代码示例

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


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

示例1: codeGen

short Assign::codeGen(Generator * generator)
{
  Attributes ** attr;

  // If this Assign has already been codeGenned, then bug out early.
  //
  MapInfo * assignMapInfo = generator->getMapInfoAsIs(getValueId());
  if (assignMapInfo && assignMapInfo->isCodeGenerated())
    return 0;

  // If the left child (lvalue) is already in the map table, then
  // add the Assign value Id to the map table with the same attributes
  // as the let child. Mark the Assign node as codeGenned. Also, allocate
  // space for the attributes.
  //
  MapInfo *leftChildMapInfo = generator->getMapInfoAsIs
    (child(0)->castToItemExpr()->getValueId());
  if (leftChildMapInfo)
    {
      if (! assignMapInfo)
	assignMapInfo = 
	  generator->addMapInfoToThis(generator->getLastMapTable(), 
				      getValueId(), 
				      leftChildMapInfo->getAttr());
      assignMapInfo->codeGenerated();
      attr = new(generator->wHeap()) Attributes*[2];

      // Set the result attribute
      //
      attr[0] = assignMapInfo->getAttr();
    }
  // Otherwise, go ahead and generate the Assign attributes (which also
  // allocates space for the Assign result). Add the left child to the
  // map table with the same attributes as the Assign node.
  //
  else
    {
      generator->getExpGenerator()->genItemExpr(this, &attr, 2, 0);
      generator->addMapInfoToThis(generator->getLastMapTable(), 
				  child(0)->castToItemExpr()->getValueId(),
				  attr[0]);
    }

  attr[0]->resetShowplan();

  // Now, generate code for the right child (rvalue).
  //
  generator->getExpGenerator()->setClauseLinked(FALSE);
  child(1)->codeGen(generator);
  attr[1] = generator->getAttr(child(1));
  generator->getExpGenerator()->setClauseLinked(FALSE);

  ex_conv_clause * conv_clause =
    new(generator->getSpace()) ex_conv_clause
    (getOperatorType(), attr, generator->getSpace());
  generator->getExpGenerator()->linkClause(this, conv_clause);

  return 0;
}
开发者ID:RuoYuHP,项目名称:incubator-trafodion,代码行数:59,代码来源:GenItemExpr.cpp

示例2: protectiveSequenceFunctionTransformation

// A transformation method for protecting sequence functions from not
// being evaluated due to short-circuit evaluation. This is the base
// class implementation which simply recurses on the children unless
// they have already been code-generated.
//
void ItemExpr::protectiveSequenceFunctionTransformation(Generator *generator)
{
  for(Int32 i=0; i<getArity(); i++)
    {
      MapInfo *mapInfo = generator->getMapInfoAsIs(child(i));
      if(!mapInfo || !mapInfo->isCodeGenerated())
	child(i)->protectiveSequenceFunctionTransformation(generator);
    }
}
开发者ID:apache,项目名称:incubator-trafodion,代码行数:14,代码来源:GenSequenceFunction.cpp

示例3: markGeneratedEntries

void
markGeneratedEntries(Generator *generator, ItemExpr *item, ValueIdSet &marks)
{
  if(item) {
    MapInfo *mapInfo =
      generator->getMapInfoAsIs(item->getValueId());
    
    if(mapInfo && mapInfo->isCodeGenerated())
      marks += item->getValueId();

    for(Int32 i = 0; i < item->getArity(); i++) {
      markGeneratedEntries(generator,item->child(i), marks);
    }
  }
}
开发者ID:RuoYuHP,项目名称:incubator-trafodion,代码行数:15,代码来源:GenItemExpr.cpp

示例4: codeGen

// ItmPersistentExpressionVar::codeGen
//
// Adds the persistent variable to the expression generator.
//
short ItmPersistentExpressionVar::codeGen(Generator * generator) {

  // If the variable has already been codeGenned, bug out...
  //
  MapInfo * mi = generator->getMapInfoAsIs(getValueId());
  if (mi && mi->isCodeGenerated()) return 0;

  // Otherwise, generate the code and add it to the map table.
  //
  generator->getExpGenerator()->addPersistent(getValueId(), 
					      generator->getMapTable());

  // Add the initial value to the persistent list in the ExpGenerator.
  //
  generator->getExpGenerator()->linkPersistent(this);

  // ok...
  //
  return 0;
}
开发者ID:RuoYuHP,项目名称:incubator-trafodion,代码行数:24,代码来源:GenFlowControlFunction.cpp


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