Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions mlir/include/mlir/IR/Block.h
Original file line number Diff line number Diff line change
Expand Up @@ -211,11 +211,11 @@ class Block : public IRObjectWithUseList<BlockOperand>,
//===--------------------------------------------------------------------===//

/// Get the terminator operation of this block. This function asserts that
/// the block has a valid terminator operation.
/// the block might have a valid terminator operation.
Operation *getTerminator();

/// Check whether this block has a terminator.
bool hasTerminator();
/// Check whether this block might have a terminator.
bool mightHaveTerminator();

//===--------------------------------------------------------------------===//
// Predecessors and successors.
Expand Down
2 changes: 1 addition & 1 deletion mlir/lib/Dialect/Transform/IR/TransformOps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2188,7 +2188,7 @@ LogicalResult transform::SequenceOp::verify() {
}
}

if (!getBodyBlock()->hasTerminator())
if (!getBodyBlock()->mightHaveTerminator())
return emitOpError() << "expects to have a terminator in the body";

if (getBodyBlock()->getTerminator()->getOperandTypes() !=
Expand Down
8 changes: 4 additions & 4 deletions mlir/lib/IR/Block.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -234,14 +234,14 @@ void Block::eraseArguments(function_ref<bool(BlockArgument)> shouldEraseFn) {
//===----------------------------------------------------------------------===//

/// Get the terminator operation of this block. This function asserts that
/// the block has a valid terminator operation.
/// the block might have a valid terminator operation.
Operation *Block::getTerminator() {
assert(hasTerminator());
assert(mightHaveTerminator());
return &back();
}

/// Check whether this block has a terminator.
bool Block::hasTerminator() {
/// Check whether this block might have a terminator.
bool Block::mightHaveTerminator() {
return !empty() && back().mightHaveTrait<OpTrait::IsTerminator>();
}

Expand Down