37 template <
class Ptr,
class USE_iterator>
38 class PredIterator :
public std::iterator<std::forward_iterator_tag,
39 Ptr, ptrdiff_t, Ptr*, Ptr*> {
41 std::iterator<std::forward_iterator_tag, Ptr, ptrdiff_t, Ptr*, Ptr*>;
45 inline void advancePastNonTerminators() {
47 while (!It.atEnd() && !isa<TerminatorInst>(*It))
57 advancePastNonTerminators();
65 assert(!It.atEnd() &&
"pred_iterator out of range!");
66 return cast<TerminatorInst>(*It)->getParent();
71 assert(!It.atEnd() &&
"pred_iterator out of range!");
72 ++It; advancePastNonTerminators();
77 Self tmp = *
this; ++*
this;
return tmp;
83 return It.getOperandNo();
150 template <
typename T,
typename U>
266 #endif // LLVM_IR_CFG_H
static NodeRef getEntryNode(const BasicBlock *BB)
iterator_range< succ_iterator > succ_range
PredIterator< BasicBlock, Value::user_iterator > pred_iterator
static NodeRef getEntryNode(Inverse< const Function * > G)
static NodeRef getEntryNode(BasicBlock *BB)
bool operator==(const Self &x) const
This provides a very simple, boring adaptor for a begin and end iterator into a range type...
static ChildIteratorType child_begin(NodeRef N)
static ChildIteratorType child_end(NodeRef N)
TerminatorInst::SuccIterator< TerminatorInst *, BasicBlock > succ_iterator
PredIterator(Ptr *bb, bool)
Use & getUse() const
getUse - Return the operand Use in the predecessor's terminator of the successor. ...
static ChildIteratorType child_end(NodeRef N)
iterator_range< const_pred_iterator > pred_const_range
A Use represents the edge between a Value definition and its users.
static NodeRef getEntryNode(Inverse< BasicBlock * > G)
Interval::succ_iterator succ_begin(Interval *I)
succ_begin/succ_end - define methods so that Intervals may be used just like BasicBlocks can with the...
static ChildIteratorType child_begin(NodeRef N)
unsigned getOperandNo() const
getOperandNo - Return the operand number in the predecessor's terminator of the successor.
iterator_range< succ_const_iterator > succ_const_range
static ChildIteratorType child_end(NodeRef N)
static ChildIteratorType child_begin(NodeRef N)
Interval::succ_iterator succ_end(Interval *I)
static nodes_iterator nodes_begin(const Function *F)
reference operator*() const
typename super::reference reference
Subclasses of this class are all able to terminate a basic block.
static NodeRef getEntryNode(Inverse< const BasicBlock * > G)
LLVM Basic Block Representation.
static NodeRef getEntryNode(Inverse< Function * > G)
bool succ_empty(const BasicBlock *BB)
Interval::pred_iterator pred_begin(Interval *I)
pred_begin/pred_end - define methods so that Intervals may be used just like BasicBlocks can with the...
iterator_range< pred_iterator > pred_range
Interval::pred_iterator pred_end(Interval *I)
static ChildIteratorType child_end(NodeRef N)
bool pred_empty(const BasicBlock *BB)
static nodes_iterator nodes_end(const Function *F)
isPodLike - This is a type trait that is used to determine whether a given type can be copied around ...
static NodeRef getEntryNode(Function *F)
pred_range predecessors(BasicBlock *BB)
const BasicBlock & getEntryBlock() const
A range adaptor for a pair of iterators.
static size_t size(const Function *F)
static NodeRef getEntryNode(const Function *F)
static ChildIteratorType child_begin(NodeRef N)
bool operator!=(const Self &x) const
PredIterator< const BasicBlock, Value::const_user_iterator > const_pred_iterator
typename super::pointer pointer
static nodes_iterator nodes_end(Function *F)
TerminatorInst::SuccIterator< const TerminatorInst *, const BasicBlock > succ_const_iterator
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
static nodes_iterator nodes_begin(Function *F)
succ_range successors(BasicBlock *BB)
static size_t size(Function *F)
pointer * operator->() const
const TerminatorInst * getTerminator() const LLVM_READONLY
Returns the terminator instruction if the block is well formed or null if the block is not well forme...