diff options
Diffstat (limited to 'mlir/lib/TableGen/Operator.cpp')
| -rw-r--r-- | mlir/lib/TableGen/Operator.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/mlir/lib/TableGen/Operator.cpp b/mlir/lib/TableGen/Operator.cpp index da86b00ebc30..926ffd0e363a 100644 --- a/mlir/lib/TableGen/Operator.cpp +++ b/mlir/lib/TableGen/Operator.cpp @@ -385,7 +385,8 @@ void Operator::populateTypeInferenceInfo( if (getTrait("::mlir::OpTrait::SameOperandsAndResultType")) { // Check for a non-variable length operand to use as the type anchor. auto *operandI = llvm::find_if(arguments, [](const Argument &arg) { - NamedTypeConstraint *operand = llvm::dyn_cast_if_present<NamedTypeConstraint *>(arg); + NamedTypeConstraint *operand = + llvm::dyn_cast_if_present<NamedTypeConstraint *>(arg); return operand && !operand->isVariableLength(); }); if (operandI == arguments.end()) @@ -663,15 +664,17 @@ void Operator::populateOpStructure() { argDef = argDef->getValueAsDef("constraint"); if (argDef->isSubClassOf(typeConstraintClass)) { - attrOrOperandMapping.push_back( - {OperandOrAttribute::Kind::Operand, operandIndex}); + attrPropOrOperandMapping.push_back( + {OperandAttrOrProp::Kind::Operand, operandIndex}); arguments.emplace_back(&operands[operandIndex++]); } else if (argDef->isSubClassOf(attrClass)) { - attrOrOperandMapping.push_back( - {OperandOrAttribute::Kind::Attribute, attrIndex}); + attrPropOrOperandMapping.push_back( + {OperandAttrOrProp::Kind::Attribute, attrIndex}); arguments.emplace_back(&attributes[attrIndex++]); } else { assert(argDef->isSubClassOf(propertyClass)); + attrPropOrOperandMapping.push_back( + {OperandAttrOrProp::Kind::Property, propIndex}); arguments.emplace_back(&properties[propIndex++]); } } @@ -867,9 +870,8 @@ auto Operator::VariableDecoratorIterator::unwrap(const Init *init) return VariableDecorator(cast<DefInit>(init)->getDef()); } -auto Operator::getArgToOperandOrAttribute(int index) const - -> OperandOrAttribute { - return attrOrOperandMapping[index]; +auto Operator::getArgToOperandAttrOrProp(int index) const -> OperandAttrOrProp { + return attrPropOrOperandMapping[index]; } std::string Operator::getGetterName(StringRef name) const { |
