Skip to content

Commit a5cb62b

Browse files
committed
fixup! fixup! [MLIR][TableGen] Warn on APInt parameter without custom comparator
1 parent b6487d8 commit a5cb62b

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

mlir/test/mlir-tblgen/apint-param-warn.td renamed to mlir/test/mlir-tblgen/apint-param-error.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: mlir-tblgen -gen-attrdef-decls -I %S/../../include %s 2>&1 | FileCheck %s
1+
// RUN: not mlir-tblgen -gen-attrdef-decls -I %S/../../include %s 2>&1 | FileCheck %s
22

33
include "mlir/IR/AttrTypeBase.td"
44
include "mlir/IR/OpBase.td"
@@ -14,4 +14,4 @@ def RawAPIntAttr : AttrDef<Test_Dialect, "RawAPInt"> {
1414
let hasCustomAssemblyFormat = 1;
1515
}
1616

17-
// CHECK: apint-param-warn.td:11:5: warning: Using a raw APInt parameter
17+
// CHECK: apint-param-error.td:11:5: error: Using a raw APInt parameter

mlir/tools/mlir-tblgen/AttrOrTypeDefGen.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -680,7 +680,7 @@ void DefGen::emitStorageClass() {
680680
storageCls->finalize();
681681
for (auto &param : params) {
682682
if (param.getCppType().contains("APInt") && !param.hasCustomComparator()) {
683-
PrintWarning(
683+
PrintError(
684684
def.getLoc(),
685685
"Using a raw APInt parameter without a custom comparator is "
686686
"not supported because an assert in the equality operator is "

0 commit comments

Comments
 (0)