Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion mlir/include/mlir/IR/Block.h
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ class Block : public IRObjectWithUseList<BlockOperand>,
Operation *getTerminator();

/// Check whether this block has a terminator.
bool hasTerminator();
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
4 changes: 2 additions & 2 deletions mlir/lib/IR/Block.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,12 +236,12 @@ 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.
Operation *Block::getTerminator() {
assert(hasTerminator());
assert(mightHaveTerminator());
return &back();
}

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

Expand Down