Skip to content

Commit 6ea6a01

Browse files
Jezurkolkorenc
authored andcommitted
hl: Improve reporting when type verification of CondOp fails.
1 parent 966c91d commit 6ea6a01

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/vast/Dialect/HighLevel/HighLevelOps.cpp

+7-1
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,13 @@ namespace vast::hl
307307
{
308308
auto then_type = get_yielded_type(getThenRegion());
309309
auto else_type = get_yielded_type(getElseRegion());
310-
return mlir::success(areTypesCompatible(then_type, else_type));
310+
bool compatible = typesMatch(then_type, else_type);
311+
if (!compatible)
312+
{
313+
VAST_REPORT("Failed to verify that return types {0}, {1} in CondOp regions match. See location {2}",
314+
then_type, else_type, getLoc());
315+
}
316+
return mlir::success(compatible);
311317
}
312318

313319
void WhileOp::build(Builder &bld, State &st, BuilderCallback cond, BuilderCallback body)

0 commit comments

Comments
 (0)