[mlir][Complex] Add a convenience getValue() method.

This method returns the value as std::complex<APFloat>

Differential Revision: https://reviews.llvm.org/D130770
This commit is contained in:
Adrian Kuegel 2022-07-29 15:17:57 +02:00
parent 3cfa9b1431
commit 7d76da539f
1 changed files with 6 additions and 0 deletions

View File

@ -53,6 +53,12 @@ def Complex_NumberAttr : Complex_Attr<"Number", "number"> {
}]>
];
let extraClassDeclaration = [{
std::complex<APFloat> getValue() {
return std::complex<APFloat>(getReal(), getImag());
}
}];
let genVerifyDecl = 1;
let hasCustomAssemblyFormat = 1;
let skipDefaultBuilders = 1;