Skip to content

Commit 7f40a2c

Browse files
also handle OpResult
1 parent ce590f4 commit 7f40a2c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

mlir/tools/mlir-tblgen/OpPythonBindingGen.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,8 @@ static void emitElementAccessors(
437437
type = std::strcmp(kind, "operand") == 0 ? "_ods_ir.Value"
438438
: "_ods_ir.OpResult";
439439
}
440-
if (std::strcmp(type.c_str(), "_ods_ir.Value") == 0 || std::strcmp(type.c_str(), "_ods_ir.OpResult") == 0) {
440+
if (std::strcmp(type.c_str(), "_ods_ir.Value") == 0 ||
441+
std::strcmp(type.c_str(), "_ods_ir.OpResult") == 0) {
441442
StringRef pythonType = getPythonType(element.constraint.getCppType());
442443
if (!pythonType.empty())
443444
type += "[" + pythonType.str() + "]";
@@ -473,7 +474,8 @@ static void emitElementAccessors(
473474
if (!element.isVariableLength() || element.isOptional()) {
474475
type = std::strcmp(kind, "operand") == 0 ? "_ods_ir.Value"
475476
: "_ods_ir.OpResult";
476-
if (std::strcmp(type.c_str(), "_ods_ir.Value") == 0 || std::strcmp(type.c_str(), "_ods_ir.OpResult") == 0) {
477+
if (std::strcmp(type.c_str(), "_ods_ir.Value") == 0 ||
478+
std::strcmp(type.c_str(), "_ods_ir.OpResult") == 0) {
477479
StringRef pythonType = getPythonType(element.constraint.getCppType());
478480
if (!pythonType.empty())
479481
type += "[" + pythonType.str() + "]";

0 commit comments

Comments
 (0)