llvm::LockstepReverseIterator

Iterates instructions across blocks in reverse from the first non-terminator.

Synopsis

Declared in <llvm/Transforms/Utils/LockstepReverseIterator.h>

template<bool EarlyFailure = true>
class LockstepReverseIterator;

Description

For example (assume all blocks have size n): LockstepReverseIterator I([B1, B2, B3]); *I-- = [B1[n], B2[n], B3[n]]; *I-- = [B1[n-1], B2[n-1], B3[n-1]]; *I-- = [B1[n-2], B2[n-2], B3[n-2]]; ...

The iterator continues processing until all blocks have been exhausted if EarlyFailure is explicitly set to false. Use getActiveBlocks() to determine which blocks are still going and the order they appear in the list returned by operator*.

Member Functions

NameDescription
LockstepReverseIterator [constructor]Construct an iterator over Blocks starting at each first non-terminator.
getActiveBlocks Return the blocks that are still active during non-early-failure iteration.
isValid Return true if the iterator still points at a valid instruction set.
operator* Return the current instructions, one from each active block.
operator++ Move to the next instruction in each active block.
operator-- Move to the previous instruction in each active block.
reset Reset the iterator to the first non-terminator of each block.
restrictToBlocks Drop instructions whose parents are not in Blocks from the active set.