operations.pop_back();
}
- /// Blocks are maintained in a Region.
- Region *getParent();
+ /// Provide a 'getParent' method for ilist_node_with_parent methods.
+ /// We mark it as a const function because ilist_node_with_parent specifically
+ /// requires a 'getParent() const' method. Once ilist_node removes this
+ /// constraint, we should drop the const to fit the rest of the MLIR const
+ /// model.
+ Region *getParent() const;
/// Returns the closest surrounding operation that contains this block.
Operation *getParentOp();
}
/// Provide a 'getParent' method for ilist_node_with_parent methods.
- /// We mark it as const function because ilist_node_with_parent specifically
+ /// We mark it as a const function because ilist_node_with_parent specifically
/// requires a 'getParent() const' method. Once ilist_node removes this
/// constraint, we should drop the const to fit the rest of the MLIR const
/// model.
llvm::DeleteContainerPointers(arguments);
}
-Region *Block::getParent() { return parentValidInstOrderPair.getPointer(); }
+Region *Block::getParent() const {
+ return parentValidInstOrderPair.getPointer();
+}
/// Returns the closest surrounding operation that contains this block or
/// nullptr if this block is unlinked.