Skip to content

Commit 3a73948

Browse files
[mlir][python] Fix ir.Value type to not break other types
Signed-off-by: Nirvedh Meshram <[email protected]>
1 parent 751a943 commit 3a73948

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mlir/tools/mlir-tblgen/OpPythonBindingGen.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ static void emitElementAccessors(
437437
type = std::strcmp(kind, "operand") == 0 ? "_ods_ir.Value"
438438
: "_ods_ir.OpResult";
439439
}
440-
if (std::strcmp(kind, "operand") == 0) {
440+
if (std::strcmp(type.c_str(), "_ods_ir.Value") == 0) {
441441
StringRef pythonType = getPythonType(element.constraint.getCppType());
442442
if (!pythonType.empty())
443443
type += "[" + pythonType.str() + "]";
@@ -473,7 +473,7 @@ static void emitElementAccessors(
473473
if (!element.isVariableLength() || element.isOptional()) {
474474
type = std::strcmp(kind, "operand") == 0 ? "_ods_ir.Value"
475475
: "_ods_ir.OpResult";
476-
if (std::strcmp(kind, "operand") == 0) {
476+
if (std::strcmp(type.c_str(), "_ods_ir.Value") == 0) {
477477
StringRef pythonType = getPythonType(element.constraint.getCppType());
478478
if (!pythonType.empty())
479479
type += "[" + pythonType.str() + "]";

0 commit comments

Comments
 (0)