When I was trying to reproduce the FuncOp operator in the Toy example Ch2, I got a compile error:
/path/to/project/build/include/Toy/ToyOps.h.inc:202:32: error: ‘class mlir::Type’ has no member named ‘getInputs’
202 | return getFunctionType().getInputs();
| ^~~~~~~~~
Finding out that FunctionOpInterfaceTrait::getFunctionType() returns mlir::Type instead of mlir::FunctionType, I tried to change the code in CH2/include/toy/Ops.td from
/path/to/llvm/build/tools/mlir/include/mlir/IR/FunctionOpInterfaces.h.inc:521:67: error: ‘class mlir::Type’ has no member named ‘clone’
521 | return (*static_cast<ConcreteOp *>(this)).getFunctionType().clone(inputs, results);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
It seems still an issue with the return type of FunctionOpInterfaceTrait::getFunctionType() since mlir::FunctionType does have a clone() method but mlir::Type does not.
This is the environment I was using when this issue occurred:
Hi!
When I was trying to reproduce the
FuncOp
operator in the Toy example Ch2, I got a compile error:Finding out that
FunctionOpInterfaceTrait::getFunctionType()
returnsmlir::Type
instead ofmlir::FunctionType
, I tried to change the code inCH2/include/toy/Ops.td
fromto
this error is gone, but another has appeared:
It seems still an issue with the return type of
FunctionOpInterfaceTrait::getFunctionType()
sincemlir::FunctionType
does have aclone()
method butmlir::Type
does not.This is the environment I was using when this issue occurred: