Пример #1
0
void HexagonCommonGEP::getBlockTraversalOrder(BasicBlock *Root,
      ValueVect &Order) {
  // Compute block ordering for a typical DT-based traversal of the flow
  // graph: "before visiting a block, all of its dominators must have been
  // visited".

  Order.push_back(Root);
  for (auto *DTN : children<DomTreeNode*>(DT->getNode(Root)))
    getBlockTraversalOrder(DTN->getBlock(), Order);
}
Пример #2
0
void HexagonCommonGEP::getBlockTraversalOrder(BasicBlock *Root,
      ValueVect &Order) {
  // Compute block ordering for a typical DT-based traversal of the flow
  // graph: "before visiting a block, all of its dominators must have been
  // visited".

  Order.push_back(Root);
  DomTreeNode *DTN = DT->getNode(Root);
  typedef GraphTraits<DomTreeNode*> GTN;
  typedef GTN::ChildIteratorType Iter;
  for (Iter I = GTN::child_begin(DTN), E = GTN::child_end(DTN); I != E; ++I)
    getBlockTraversalOrder((*I)->getBlock(), Order);
}