58 lines · plain
1R"(2 3//===----------------------------------------------------------------------===//4// __NAMESPACE_PATH__::__OP_CPP_NAME__ definitions5//===----------------------------------------------------------------------===//6 7__NAMESPACE_OPEN__8 9__OP_VERIFIER_HELPERS__10 11__OP_BUILD_DEFS__12 13void __OP_CPP_NAME__::build(::mlir::OpBuilder &odsBuilder,14 ::mlir::OperationState &odsState,15 ::mlir::TypeRange resultTypes,16 ::mlir::ValueRange operands,17 ::llvm::ArrayRef<::mlir::NamedAttribute> attributes)18{19 assert(operands.size() == __OP_OPERAND_COUNT__);20 assert(resultTypes.size() == __OP_RESULT_COUNT__);21 odsState.addOperands(operands);22 odsState.addAttributes(attributes);23 odsState.addTypes(resultTypes);24 for (unsigned i = 0; i != __OP_REGION_COUNT__; ++i) {25 (void)odsState.addRegion();26 }27}28 29__OP_CPP_NAME__30__OP_CPP_NAME__::create(::mlir::OpBuilder &odsBuilder,31 ::mlir::Location location,32 ::mlir::TypeRange resultTypes,33 ::mlir::ValueRange operands,34 ::llvm::ArrayRef<::mlir::NamedAttribute> attributes)35{36 ::mlir::OperationState state(location, getOperationName());37 build(odsBuilder, state, resultTypes, operands, attributes);38 auto res = ::llvm::dyn_cast<__OP_CPP_NAME__>(odsBuilder.create(state));39 assert(res && "builder didn't return the right type");40 return res;41}42 43__OP_CPP_NAME__44__OP_CPP_NAME__::create(::mlir::ImplicitLocOpBuilder &odsBuilder,45 ::mlir::TypeRange resultTypes,46 ::mlir::ValueRange operands,47 ::llvm::ArrayRef<::mlir::NamedAttribute> attributes)48{49 return create(odsBuilder, odsBuilder.getLoc(), resultTypes, operands, attributes);50}51 52__OP_VERIFIER__53 54__NAMESPACE_CLOSE__55 56MLIR_DEFINE_EXPLICIT_TYPE_ID(__NAMESPACE_PATH__::__OP_CPP_NAME__)57)"58