aboutsummaryrefslogtreecommitdiff
path: root/mlir/lib/Dialect/EmitC/IR/EmitC.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'mlir/lib/Dialect/EmitC/IR/EmitC.cpp')
-rw-r--r--mlir/lib/Dialect/EmitC/IR/EmitC.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/mlir/lib/Dialect/EmitC/IR/EmitC.cpp b/mlir/lib/Dialect/EmitC/IR/EmitC.cpp
index 0992ce14..d478220 100644
--- a/mlir/lib/Dialect/EmitC/IR/EmitC.cpp
+++ b/mlir/lib/Dialect/EmitC/IR/EmitC.cpp
@@ -584,6 +584,10 @@ void ForOp::print(OpAsmPrinter &p) {
LogicalResult ForOp::verifyRegions() {
// Check that the body defines as single block argument for the induction
// variable.
+ if (getBody()->getNumArguments() != 1)
+ return emitOpError("expected body to have a single block argument for the "
+ "induction variable");
+
if (getInductionVar().getType() != getLowerBound().getType())
return emitOpError(
"expected induction variable to be same type as bounds and step");