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


C++ ListIterator::set方法代码示例

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


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

示例1: postDominators

void
TR_ExpressionsSimplification::removeUncertainBlocks(TR_RegionStructure* region, List<TR::Block> *candidateBlocksList)
   {
   // Examine the top region block first
   //
   TR::Block *entryBlock = _currentRegion->getEntryBlock();
   ListIterator<TR::Block> blocks;
   blocks.set(candidateBlocksList);

   if (trace())
      traceMsg(comp(), "Number of blocks %d, entry block number %d\n", candidateBlocksList->getSize(), entryBlock->getNumber());

   for (TR::Block *block = blocks.getFirst(); block; block = blocks.getNext())
      {
      TR::CFGNode *cfgNode = block;
      if (!(cfgNode->getExceptionSuccessors().empty()) || blockHasCalls(block, comp()))
         {
         if (trace())
            traceMsg(comp(), "An exception can be thrown from block_%d. Removing all the blocks, since we cannot know the number of iterations.\n", block->getNumber());
         candidateBlocksList->deleteAll();
         break;
         }
      }

   TR_PostDominators postDominators(comp());
   if (postDominators.isValid())
      {
	  postDominators.findControlDependents();
      for (TR::Block *block = blocks.getFirst(); block; block = blocks.getNext())
         {
         if (postDominators.dominates(block, entryBlock) == 0)
            {
            candidateBlocksList->remove(block);
            if (trace())
               traceMsg(comp(), "Block_%d is not guaranteed to be executed at least once. Removing it from the list.\n", block->getNumber());
            }
         }
      }
   else
      {
	  if (trace())
	     traceMsg(comp(), "There is no post dominators information. Removing all the blocks.\n");
	  for (TR::Block *block = blocks.getFirst(); block; block = blocks.getNext())
	     {
	     candidateBlocksList->remove(block);
	     if (trace())
	        traceMsg(comp(), "Block_%d is removed from the list\n", block->getNumber());
	     }
      }
   }
开发者ID:dinogun,项目名称:omr,代码行数:50,代码来源:ExpressionsSimplification.cpp

示例2: traceMsg

void
TR_ExpressionsSimplification::findAndSimplifyInvariantLoopExpressions(TR_RegionStructure * region)
   {
   _currentRegion = region;
   TR::Block *entryBlock = _currentRegion->getEntryBlock();
   if (trace())
      traceMsg(comp(), "Entry block: %p in loop region %p\n", entryBlock, region);


   // Generate a list of blocks that can be processed
   // Criteria: the block must be excucted exactly once
   //
   TR_ScratchList<TR::Block> candidateBlocksList(trMemory());
   _currentRegion->getBlocks(&candidateBlocksList);

   if (candidateBlocksList.getSize() > 1)
      {
      if (trace())
         traceMsg(comp(), "More than 1 blocks in the natural loop, need to remove uncertain blocks\n");

      removeUncertainBlocks(_currentRegion, &candidateBlocksList);

      if (candidateBlocksList.getSize() < 1)
         return;
      }

   _currentRegion->resetInvariance();
   _currentRegion->computeInvariantExpressions();

   // The rest is the transformation
   //
   // For each block that is definitely executed once
   // analyze its nodes
   //
   ListIterator<TR::Block> candidateBlocks;
   candidateBlocks.set(&candidateBlocksList);
   simplifyInvariantLoopExpressions(candidateBlocks);
   }
开发者ID:dinogun,项目名称:omr,代码行数:38,代码来源:ExpressionsSimplification.cpp


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