| 1 | R"( |
| 2 | |
| 3 | //===----------------------------------------------------------------------===// |
| 4 | // __NAMESPACE_PATH__::__OP_CPP_NAME__ definitions |
| 5 | //===----------------------------------------------------------------------===// |
| 6 | |
| 7 | __NAMESPACE_OPEN__ |
| 8 | |
| 9 | __OP_VERIFIER_HELPERS__ |
| 10 | |
| 11 | __OP_BUILD_DEFS__ |
| 12 | |
| 13 | void __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 = odsBuilder.create(state); |
| 39 | assert((::llvm::isa<__OP_CPP_NAME__>(res)) && "builder didn't return the right type"); |
| 40 | return ::llvm::cast<__OP_CPP_NAME__>(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 | |
| 56 | MLIR_DEFINE_EXPLICIT_TYPE_ID(__NAMESPACE_PATH__::__OP_CPP_NAME__) |
| 57 | )" |
| 58 | |