diff --git a/mlir/include/mlir/Dialect/Complex/IR/ComplexAttributes.td b/mlir/include/mlir/Dialect/Complex/IR/ComplexAttributes.td --- a/mlir/include/mlir/Dialect/Complex/IR/ComplexAttributes.td +++ b/mlir/include/mlir/Dialect/Complex/IR/ComplexAttributes.td @@ -53,6 +53,12 @@ }]> ]; + let extraClassDeclaration = [{ + std::complex getValue() { + return std::complex(getReal(), getImag()); + } + }]; + let genVerifyDecl = 1; let hasCustomAssemblyFormat = 1; let skipDefaultBuilders = 1;