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


C++ IteratorRef::get方法代码示例

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


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

示例1: findDominanceFrontiers

void DominatorTree::findDominanceFrontiers()
{
   BasicBlock *bb;

   for (IteratorRef dtIt = iteratorDFS(false); !dtIt->end(); dtIt->next()) {
      EdgeIterator succIt, chldIt;

      bb = BasicBlock::get(reinterpret_cast<Node *>(dtIt->get()));
      bb->getDF().clear();

      for (succIt = bb->cfg.outgoing(); !succIt.end(); succIt.next()) {
         BasicBlock *dfLocal = BasicBlock::get(succIt.getNode());
         if (dfLocal->idom() != bb)
            bb->getDF().insert(dfLocal);
      }

      for (chldIt = bb->dom.outgoing(); !chldIt.end(); chldIt.next()) {
         BasicBlock *cb = BasicBlock::get(chldIt.getNode());

         DLList::Iterator dfIt = cb->getDF().iterator();
         for (; !dfIt.end(); dfIt.next()) {
            BasicBlock *dfUp = BasicBlock::get(dfIt);
            if (dfUp->idom() != bb)
               bb->getDF().insert(dfUp);
         }
      }
   }
}
开发者ID:Distrotech,项目名称:Mesa,代码行数:28,代码来源:nv50_ir_ssa.cpp

示例2:

bool
Pass::doRun(Function *func, bool ordered, bool skipPhi)
{
   IteratorRef bbIter;
   BasicBlock *bb;
   Instruction *insn, *next;

   this->func = func;
   if (!visit(func))
      return false;

   bbIter = ordered ? func->cfg.iteratorCFG() : func->cfg.iteratorDFS();

   for (; !bbIter->end(); bbIter->next()) {
      bb = BasicBlock::get(reinterpret_cast<Graph::Node *>(bbIter->get()));
      if (!visit(bb))
         break;
      for (insn = skipPhi ? bb->getEntry() : bb->getFirst(); insn != NULL;
           insn = next) {
         next = insn->next;
         if (!visit(insn))
            break;
      }
   }

   return !err;
}
开发者ID:venkatarajasekhar,项目名称:Qt,代码行数:27,代码来源:nv50_ir_bb.cpp

示例3: classifyEdges

void Graph::classifyEdges()
{
   int seq;

   for (IteratorRef it = iteratorDFS(true); !it->end(); it->next()) {
      Node *node = reinterpret_cast<Node *>(it->get());
      node->visit(0);
      node->tag = 0;
   }

   classifyDFS(root, (seq = 0));

   sequence = seq;
}
开发者ID:Ponozhovshchina,项目名称:mesa,代码行数:14,代码来源:nv50_ir_graph.cpp

示例4: CFGIterator

   CFGIterator(Graph *graph)
   {
      nodes = new Graph::Node * [graph->getSize() + 1];
      count = 0;
      pos = 0;
      nodes[graph->getSize()] = 0;

      // TODO: argh, use graph->sequence instead of tag and just raise it by > 1
      for (IteratorRef it = graph->iteratorDFS(); !it->end(); it->next())
         reinterpret_cast<Graph::Node *>(it->get())->tag = 0;

      if (graph->getRoot())
         search(graph->getRoot(), graph->nextSequence());
   }
开发者ID:Ponozhovshchina,项目名称:mesa,代码行数:14,代码来源:nv50_ir_graph.cpp

示例5: fopen

void
Function::printCFGraph(const char *filePath)
{
   FILE *out = fopen(filePath, "a");
   if (!out) {
      ERROR("failed to open file: %s\n", filePath);
      return;
   }
   INFO("printing control flow graph to: %s\n", filePath);

   fprintf(out, "digraph G {\n");

   for (IteratorRef it = cfg.iteratorDFS(); !it->end(); it->next()) {
      BasicBlock *bb = BasicBlock::get(
         reinterpret_cast<Graph::Node *>(it->get()));
      int idA = bb->getId();
      for (Graph::EdgeIterator ei = bb->cfg.outgoing(); !ei.end(); ei.next()) {
         int idB = BasicBlock::get(ei.getNode())->getId();
         switch (ei.getType()) {
         case Graph::Edge::TREE:
            fprintf(out, "\t%i -> %i;\n", idA, idB);
            break;
         case Graph::Edge::FORWARD:
            fprintf(out, "\t%i -> %i [color=green];\n", idA, idB);
            break;
         case Graph::Edge::CROSS:
            fprintf(out, "\t%i -> %i [color=red];\n", idA, idB);
            break;
         case Graph::Edge::BACK:
            fprintf(out, "\t%i -> %i;\n", idA, idB);
            break;
         case Graph::Edge::DUMMY:
            fprintf(out, "\t%i -> %i [style=dotted];\n", idA, idB);
            break;
         default:
            assert(0);
            break;
         }
      }
   }

   fprintf(out, "}\n");
   fclose(out);
}
开发者ID:venkatarajasekhar,项目名称:Qt,代码行数:44,代码来源:nv50_ir_bb.cpp

示例6: cfg

DominatorTree::DominatorTree(Graph *cfgraph) : cfg(cfgraph),
                                               count(cfg->getSize())
{
   int i = 0;

   vert = new Node * [count];
   data = new int[5 * count];

   for (IteratorRef it = cfg->iteratorDFS(true); !it->end(); it->next(), ++i) {
      vert[i] = reinterpret_cast<Node *>(it->get());
      vert[i]->tag = i;
      LABEL(i) = i;
      SEMI(i) = ANCESTOR(i) = -1;
   }
   assert(i == count);

   build();

   delete[] vert;
   delete[] data;
}
开发者ID:Distrotech,项目名称:Mesa,代码行数:21,代码来源:nv50_ir_ssa.cpp

示例7:

Graph::~Graph()
{
   for (IteratorRef it = safeIteratorDFS(); !it->end(); it->next())
      reinterpret_cast<Node *>(it->get())->cut();
}
开发者ID:Ponozhovshchina,项目名称:mesa,代码行数:5,代码来源:nv50_ir_graph.cpp


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