<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/121912>121912</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
On trying to use mlir-tblgen tool for generating op-defs getting error
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
Vishakh2012
</td>
</tr>
</table>
<pre>
on running the following command `mlir-tblgen toyOp.td -gen-op-decls -I ~/llvm-project/mlir/include -o ToyOp.h`
I get the following error
```
Included from toyOp.td:1:
Included from /home/vishforit/llvm-project/mlir/include/mlir/IR/OpBase.td:18:
Included from /home/vishforit/llvm-project/mlir/include/mlir/IR/Interfaces.td:16:
Included from /home/vishforit/llvm-project/mlir/include/mlir/IR/AttrTypeBase.td:17:
Included from /home/vishforit/llvm-project/mlir/include/mlir/IR/CommonAttrConstraints.td:17:
/home/vishforit/llvm-project/mlir/include/mlir/IR/CommonTypeConstraints.td:724:5: error: Record `F64Tensor' does not have a field named `cppClassName'!
def F64Tensor : TensorOf<[F64]>;
^
```
the code in toyOp.td is the following
```
include "mlir/IR/OpBase.td"
include "./toy.td"
class Toy_Op<string mnemonic, list<Trait> traits = []> :
Op<Toy_Dialect, mnemonic, traits>;
def ConstantOp : Toy_Op<"constant"> {
// Provide a summary and description for this operation. This can be used to
// auto-generate documentation of the operations within our dialect.
let summary = "constant operation";
let description = [{
Constant operation turns a literal into an SSA value. The data is attached
to the operation as an attribute. For example:
%0 = "toy.constant"()
{ value = dense<[[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]]> : tensor<2x3xf64> }
: () -> tensor<2x3xf64>
}];
// The constant operation takes an attribute as the only input.
// `F64ElementsAttr` corresponds to a 64-bit floating-point ElementsAttr.
let arguments = (ins F64ElementsAttr:$value);
// The generic call operation returns a single value of TensorType.
// F64Tensor corresponds to a 64-bit floating-point TensorType.
let results = (outs F64Tensor);
// Add additional verification logic to the constant operation. Setting this bit
// to `1` will generate a `::llvm::LogicalResult verify()` declaration on the
// operation class that is called after ODS constructs have been verified, for
// example the types of arguments and results. We implement additional verification
// in the definition of this `verify` method in the C++ source file.
let hasVerifier = 1;
let builders = [
// Build a constant with a given constant tensor value.
OpBuilder<(ins "DenseElementsAttr":$value), [{
// Call into an autogenerated `build` method.
build(builder, result, value.getType(), value);
}]>,
// Build a constant with a given constant floating-point value. This builder
// creates a declaration for `ConstantOp::build` with the given parameters.
OpBuilder<(ins "double":$value)>
];
}
```
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJy0V09v474R_TT0ZWBDomQ5OfhgOzEQoGiK3eDXY0GLI4tdihRIKllf-tmLIWXJTrb_gC5gwBL_zMybefNICe_V2SBu2XrP1k8LMYTWuu0fyrfiR8uznC9OVl621oAbjFHmDKFFaKzW9oPeatt1wkhgVdZp5ZbhpM9oINjLa78KEpZnNEvbLyXW2sPyBf7B-FHr927ZO_t3rAPjR9rI-FGZWg8SYWnhLW5vWZWxbPcCZwyf3KJz1gHLdvSrsvGX7V6SDQmNs90UBSt2OSt2X-YZP7a2Q8aP78q3jXUq_Kfo5oGXb4wfX_u98Di6ePg9Pl5MQNeIGv3op_o9fnYhuLdLjzeINr_H08F2nTXk72CND04oE_y9y_-XEwL0xcmGl6zYrVmxS0Sih29YWxd5fKzKNzTeOsY3IC16MDZAK94RBDQKtQQjOoxr674_aOH9nwXFumE8T5yU2MBkB4AcpOfXhhUHtt4fq5Ktn1jxzIo9y3YAAGz9_InNLNsR7WsrEdRNUyl_3w6ftl0biXH-a65yfr9qxfgx2Ms0VRMkasK_vfasOPjgqOc6g501qmb8AFr5wIrDmxMqsOIZKL3BAyueICkJDaZKErRohuw9KaFj7Q535tL2KRtzDmPphAmvfcrhNSTGeT1OUcjkbJPyyPiR8SP8xdl3Jalifug64S5AKiXR1071QVkDjXUQWuXB9ugEDa3gjd5rYeCEMHiUEOytUTEES4JG6xGkrYcOTYh7wTaxJ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