Revert "[mlir][ods] (NFC) Remove warning in `AttrOrTypeDef`"

This reverts commit e45ef5ebf4.
This commit is contained in:
Jeff Niu 2022-07-19 10:25:24 -07:00
parent e46f727b38
commit 2d05418b17
1 changed files with 8 additions and 0 deletions

View File

@ -85,6 +85,14 @@ AttrOrTypeDef::AttrOrTypeDef(const llvm::Record *def) : def(def) {
"'assemblyFormat' or 'hasCustomAssemblyFormat' can only be "
"used when 'mnemonic' is set");
}
// Assembly format parser requires builders with the same prototype
// as the default-builders.
// TODO: attempt to detect when a custom builder matches the prototype.
if (hasDeclarativeFormat && skipDefaultBuilders()) {
PrintWarning(getLoc(),
"using 'assemblyFormat' with 'skipDefaultBuilders=1' may "
"result in C++ compilation errors");
}
// Assembly format printer requires accessors to be generated.
if (hasDeclarativeFormat && !genAccessors()) {
PrintFatalError(getLoc(),