15 : numRegions(op->getNumRegions()), nextRegion(0) {}
31 for (
auto &block : region) {
32 for (
auto &nestedOp : block)
33 walk(&nestedOp, callback, order);
44 for (
auto &block : llvm::make_early_inc_range(region)) {
47 for (
auto &nestedOp : block)
48 walk(&nestedOp, callback, order);
62 for (
auto &block : region) {
64 for (
auto &nestedOp : llvm::make_early_inc_range(block))
65 walk(&nestedOp, callback, order);
82 for (
Block &block : region) {
84 walk(&nestedOp, callback);
115 for (
auto &block : region) {
116 for (
auto &nestedOp : block)
117 if (
walk(&nestedOp, callback, order).wasInterrupted())
121 if (callback(®ion).wasInterrupted())
135 for (
auto &block : llvm::make_early_inc_range(region)) {
143 for (
auto &nestedOp : block)
144 if (
walk(&nestedOp, callback, order).wasInterrupted())
147 if (callback(&block).wasInterrupted())
171 for (
auto &block : region) {
173 for (
auto &nestedOp : llvm::make_early_inc_range(block)) {
174 if (
walk(&nestedOp, callback, order).wasInterrupted())
201 for (
Block &block : region) {
203 for (
Operation &nestedOp : llvm::make_early_inc_range(block))
204 if (
walk(&nestedOp, callback).wasInterrupted())
208 return callback(op, stage);
Include the generated interface declarations.
This class contains a list of basic blocks and a link to the parent operation it is attached to...
Operation is a basic unit of execution within MLIR.
MutableArrayRef< Region > getRegions()
Returns the regions held by this operation.
Block represents an ordered list of Operations.
bool wasInterrupted() const
Returns true if the walk was interrupted.
void advance()
Advance the walk stage.
static WalkResult advance()
A utility class to encode the current walk stage for "generic" walkers.
static WalkResult interrupt()
A utility result that is used to signal how to proceed with an ongoing walk:
void walk(Operation *op, function_ref< void(Region *)> callback, WalkOrder order)
Walk all of the regions, blocks, or operations nested under (and including) the given operation...
bool wasSkipped() const
Returns true if the walk was skipped.
WalkOrder
Traversal order for region, block and operation walk utilities.