Skip to content

Commit e5521fa

Browse files
mdehlingMalte Dehling
andauthored
[mlir-tblgen] Fix bug in emitEnumDoc (#118131)
Fixes a crash (assertion failure) in `mlir-tblgen -emit-enum-doc` caused by calling `EnumAttr()` for the wrong type of `Record *`: `EnumAttr` rather than `EnumAttrInfo` as asserted. Compare the corresponding line in `emitDialectDoc()`: https://github.com/llvm/llvm-project/blob/0ad6be1927f89cef09aa5d0fb244873f687997c9/mlir/tools/mlir-tblgen/OpDocGen.cpp#L532 Co-authored-by: Malte Dehling <[email protected]>
1 parent 83643dd commit e5521fa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mlir/tools/mlir-tblgen/OpDocGen.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ static void emitEnumDoc(const EnumAttr &def, raw_ostream &os) {
409409

410410
static void emitEnumDoc(const RecordKeeper &records, raw_ostream &os) {
411411
os << "<!-- Autogenerated by mlir-tblgen; don't manually edit -->\n";
412-
for (const Record *def : records.getAllDerivedDefinitions("EnumAttr"))
412+
for (const Record *def : records.getAllDerivedDefinitions("EnumAttrInfo"))
413413
emitEnumDoc(EnumAttr(def), os);
414414
}
415415

0 commit comments

Comments
 (0)