Skip to content

Commit c6bfbc5

Browse files
authored
[mlir] Simplify unreachable type switch cases. NFC. (#162032)
Use `DefaultUnreachable` from llvm/llvm-project#161970.
1 parent ae75929 commit c6bfbc5

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

mlir/tools/mlir-tblgen/AttrOrTypeFormatGen.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,7 @@ static ParameterElement *getEncapsulatedParameterElement(FormatElement *el) {
8989
.Case<ParameterElement>([&](auto param) { return param; })
9090
.Case<RefDirective>(
9191
[&](auto ref) { return cast<ParameterElement>(ref->getArg()); })
92-
.Default([&](auto el) {
93-
assert(false && "unexpected struct element type");
94-
return nullptr;
95-
});
92+
.DefaultUnreachable("unexpected struct element type");
9693
}
9794

9895
/// Shorthand functions that can be used with ranged-based conditions.

0 commit comments

Comments
 (0)