summaryrefslogtreecommitdiffstats
path: root/mlir/lib/IR/Operation.cpp
diff options
context:
space:
mode:
authorChris Lattner <clattner@google.com>2018-12-26 11:21:53 -0800
committerjpienaar <jpienaar@google.com>2019-03-29 14:36:35 -0700
commitd613f5ab65bbb80c3f5a0a38fef22cb4878c4358 (patch)
treedfa4207dd899f87741ad784fe8fc343afba6885d /mlir/lib/IR/Operation.cpp
parent9a4060d3f50f046973d4e0b61f324bbc6ebbbdb9 (diff)
downloadbcm5719-llvm-d613f5ab65bbb80c3f5a0a38fef22cb4878c4358.tar.gz
bcm5719-llvm-d613f5ab65bbb80c3f5a0a38fef22cb4878c4358.zip
Refactor MLFunction to contain a StmtBlock for its body instead of inheriting
from it. This is necessary progress to squaring away the parent relationship that a StmtBlock has with its enclosing if/for/fn, and makes room for functions to have more than one block in the future. This also removes IfClause and ForStmtBody. This is step 5/n towards merging instructions and statements, NFC. PiperOrigin-RevId: 226936541
Diffstat (limited to 'mlir/lib/IR/Operation.cpp')
-rw-r--r--mlir/lib/IR/Operation.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/mlir/lib/IR/Operation.cpp b/mlir/lib/IR/Operation.cpp
index d3a618d7da5..c946a76a98b 100644
--- a/mlir/lib/IR/Operation.cpp
+++ b/mlir/lib/IR/Operation.cpp
@@ -581,7 +581,7 @@ bool OpTrait::impl::verifyIsTerminator(const Operation *op) {
// Verify that the operation is at the end of the respective parent block.
if (auto *stmt = dyn_cast<OperationStmt>(op)) {
StmtBlock *block = stmt->getBlock();
- if (!block || !isa<MLFunction>(block) || &block->back() != stmt)
+ if (!block || block->getContainingStmt() || &block->back() != stmt)
return op->emitOpError("must be the last statement in the ML function");
} else {
const Instruction *inst = cast<Instruction>(op);
OpenPOWER on IntegriCloud