41template <
class Ptr, 
class USE_iterator> 
 
   58        assert(Inst->isTerminator() && 
"BasicBlock used in non-terminator");
 
 
   77    assert(!
It.atEnd() && 
"pred_iterator out of range!");
 
 
   83    assert(!
It.atEnd() && 
"pred_iterator out of range!");
 
 
   89    Self tmp = *
this; ++*
this; 
return tmp;
 
 
   95    return It.getOperandNo();
 
 
 
  138template <
class InstructionT, 
class BlockT>
 
  141                                  std::random_access_iterator_tag, BlockT, int,
 
  142                                  BlockT *, BlockT *> {
 
  154  inline bool index_is_valid(
int Idx) {
 
  157    return Idx >= 0 && (Idx == 0 || Idx <= (int)Inst->getNumSuccessors());
 
  161  class SuccessorProxy {
 
  165    explicit SuccessorProxy(
const Self &It) : It(It) {}
 
  167    SuccessorProxy(
const SuccessorProxy &) = 
default;
 
  169    SuccessorProxy &operator=(SuccessorProxy 
RHS) {
 
  175      It.Inst->setSuccessor(It.Idx, 
RHS);
 
  179    operator reference()
 const { 
return *It; }
 
  184  explicit inline SuccIterator(InstructionT *Inst) : Inst(Inst), Idx(0) {}
 
  188      Idx = Inst->getNumSuccessors();
 
 
  203  inline bool operator==(
const Self &x)
 const { 
return Idx == x.Idx; }
 
  205  inline BlockT *
operator*()
 const { 
return Inst->getSuccessor(Idx); }
 
  211    assert(Inst == 
RHS.Inst && 
"Cannot compare iterators of different blocks!");
 
  212    return Idx < 
RHS.Idx;
 
 
  216    assert(Inst == 
RHS.Inst && 
"Cannot compare iterators of different blocks!");
 
  217    return Idx - 
RHS.Idx;
 
 
  221    int NewIdx = Idx + 
RHS;
 
  222    assert(index_is_valid(NewIdx) && 
"Iterator index out of bound");
 
 
  234    return SuccessorProxy(TmpIt);
 
 
  239    assert(Inst && 
"Source not available, if basic block was malformed");
 
  240    return Inst->getParent();
 
 
 
  314              "GraphTraits getNumber() not detected");
 
  329              "GraphTraits getNumber() not detected");
 
  348              "GraphTraits getNumber() not detected");
 
  362              "GraphTraits getNumber() not detected");
 
  389    return F->getMaxBlockNumber();
 
 
  392    return F->getBlockNumberEpoch();
 
 
 
  413    return F->getMaxBlockNumber();
 
 
  416    return F->getBlockNumberEpoch();
 
 
 
  428    return &
G.Graph->getEntryBlock();
 
 
  432    return F->getMaxBlockNumber();
 
 
  435    return F->getBlockNumberEpoch();
 
 
 
  441    return &
G.Graph->getEntryBlock();
 
 
  445    return F->getMaxBlockNumber();
 
 
  448    return F->getBlockNumberEpoch();
 
 
 
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
This file defines the little GraphTraits<X> template class that should be specialized by classes that...
LLVM Basic Block Representation.
unsigned getNumber() const
const Instruction * getTerminator() const LLVM_READONLY
Returns the terminator instruction if the block is well formed or null if the block is not well forme...
bool operator==(const Self &x) const
void advancePastNonTerminators()
PredIterator(Ptr *bb, bool)
bool operator!=(const Self &x) const
std::forward_iterator_tag iterator_category
reference operator*() const
PredIterator< Ptr, USE_iterator > Self
std::ptrdiff_t difference_type
pointer * operator->() const
unsigned getOperandNo() const
getOperandNo - Return the operand number in the predecessor's terminator of the successor.
Use & getUse() const
getUse - Return the operand Use in the predecessor's terminator of the successor.
std::ptrdiff_t difference_type
bool operator==(const Self &x) const
SuccIterator(InstructionT *Inst, bool)
Self & operator-=(int RHS)
int getSuccessorIndex() const
This is used to interface between code that wants to operate on terminator instructions directly.
BlockT * operator->() const
bool operator<(const Self &RHS) const
BlockT * operator*() const
BlockT * getSource()
Get the source BlockT of this iterator.
SuccessorProxy operator[](int Offset)
Self & operator+=(int RHS)
int operator-(const Self &RHS) const
SuccIterator(InstructionT *Inst)
A Use represents the edge between a Value definition and its users.
CRTP base class which implements the entire standard iterator facade in terms of a minimal subset of ...
A range adaptor for a pair of iterators.
This provides a very simple, boring adaptor for a begin and end iterator into a range type.
This is an optimization pass for GlobalISel generic memory operations.
bool succ_empty(const Instruction *I)
iterator_range< pred_iterator > pred_range
iterator_range< succ_iterator > succ_range
auto pred_end(const MachineBasicBlock *BB)
decltype(auto) dyn_cast(const From &Val)
dyn_cast<X> - Return the argument parameter cast to the specified type.
auto successors(const MachineBasicBlock *BB)
constexpr bool GraphHasNodeNumbers
Indicate whether a GraphTraits<NodeT>::getNumber() is supported.
iterator_range< const_pred_iterator > const_pred_range
auto pred_size(const MachineBasicBlock *BB)
PredIterator< const BasicBlock, Value::const_user_iterator > const_pred_iterator
auto succ_size(const MachineBasicBlock *BB)
RNSuccIterator< NodeRef, BlockT, RegionT > succ_begin(NodeRef Node)
RNSuccIterator< NodeRef, BlockT, RegionT > succ_end(NodeRef Node)
PredIterator< BasicBlock, Value::user_iterator > pred_iterator
auto pred_begin(const MachineBasicBlock *BB)
decltype(auto) cast(const From &Val)
cast<X> - Return the argument parameter cast to the specified type.
auto predecessors(const MachineBasicBlock *BB)
SuccIterator< Instruction, BasicBlock > succ_iterator
bool pred_empty(const BasicBlock *BB)
SuccIterator< const Instruction, const BasicBlock > const_succ_iterator
iterator_range< const_succ_iterator > const_succ_range
static NodeRef getEntryNode(BasicBlock *BB)
succ_iterator ChildIteratorType
static ChildIteratorType child_begin(NodeRef N)
static unsigned getNumber(const BasicBlock *BB)
static ChildIteratorType child_end(NodeRef N)
static unsigned getMaxNumber(const Function *F)
static nodes_iterator nodes_begin(Function *F)
static unsigned getNumberEpoch(const Function *F)
static nodes_iterator nodes_end(Function *F)
static size_t size(Function *F)
static NodeRef getEntryNode(Function *F)
pointer_iterator< Function::iterator > nodes_iterator
static ChildIteratorType child_begin(NodeRef N)
static unsigned getNumber(const BasicBlock *BB)
static ChildIteratorType child_end(NodeRef N)
pred_iterator ChildIteratorType
static NodeRef getEntryNode(Inverse< BasicBlock * > G)
static unsigned getNumberEpoch(const Function *F)
static unsigned getMaxNumber(const Function *F)
static NodeRef getEntryNode(Inverse< Function * > G)
static ChildIteratorType child_end(NodeRef N)
const_pred_iterator ChildIteratorType
const BasicBlock * NodeRef
static NodeRef getEntryNode(Inverse< const BasicBlock * > G)
static ChildIteratorType child_begin(NodeRef N)
static unsigned getNumber(const BasicBlock *BB)
static unsigned getMaxNumber(const Function *F)
static NodeRef getEntryNode(Inverse< const Function * > G)
static unsigned getNumberEpoch(const Function *F)
const BasicBlock * NodeRef
static ChildIteratorType child_begin(NodeRef N)
static unsigned getNumber(const BasicBlock *BB)
static NodeRef getEntryNode(const BasicBlock *BB)
const_succ_iterator ChildIteratorType
static ChildIteratorType child_end(NodeRef N)
static size_t size(const Function *F)
static nodes_iterator nodes_begin(const Function *F)
static NodeRef getEntryNode(const Function *F)
static unsigned getNumberEpoch(const Function *F)
static unsigned getMaxNumber(const Function *F)
static nodes_iterator nodes_end(const Function *F)
pointer_iterator< Function::const_iterator > nodes_iterator
typename Function *::UnknownGraphTypeError NodeRef