I am getting errors in tablegen generated files when I try to build llvm using ninja. Following are few of theerrors:
In file included from /home/user3/LLVM_MLIR/llvm-project/mlir/lib/Dialect/MyToy/IR/MyToyOps.cpp:13:
tools/mlir/include/mlir/Dialect/MyToy/IR/MyToyOps.cpp.inc:992:18: error: ‘getOperation’ was not declared in this scope; did you mean ‘Operation’?
992 | _odsPrinter << getOperation()->getResultTypes();
| ^~~~~~~~~~~~
| Operation
In file included from /home/user3/LLVM_MLIR/llvm-project/mlir/lib/Dialect/MyToy/IR/MyToyOps.cpp:13:
tools/mlir/include/mlir/Dialect/MyToy/IR/MyToyOps.cpp.inc:991:15: error: no match for ‘operator<<’ (operand types are ‘mlir::OpAsmPrinter’ and ‘char’)
991 | _odsPrinter << ' ';
| ~~~~~~~~~~~ ^~ ~~~
| | |
| | char
| mlir::OpAsmPrinter
Why is this happening? Isn’t tablegen supposed to generate correct code?
Kindly help.