[mlir][ods] NFC fix tblgen crash with empty assembly format

This commit is contained in:
Mogball 2022-02-08 21:13:58 +00:00
parent d379ec9908
commit 72619d101f
1 changed files with 2 additions and 0 deletions

View File

@ -812,6 +812,8 @@ LogicalResult DefFormatParser::verify(SMLoc loc,
it.value().getName());
}
}
if (elements.empty())
return success();
// A `struct` directive that contains optional parameters cannot be followed
// by a comma literal, which is ambiguous.
for (auto it : llvm::zip(elements.drop_back(), elements.drop_front())) {