cleanup(compiler): Remove custom print and parse TFHE types

This commit is contained in:
Quentin Bourgerie
2022-06-16 09:52:23 +02:00
parent 9dd776533a
commit acbb5bf17a
3 changed files with 1 additions and 26 deletions

View File

@@ -18,11 +18,6 @@ def TFHE_Dialect : Dialect {
A dialect for representation of high level operation on fully homomorphic ciphertext.
}];
let cppNamespace = "::mlir::concretelang::TFHE";
let useDefaultTypePrinterParser = 0;
let extraClassDeclaration = [{
::mlir::Type parseType(::mlir::DialectAsmParser &parser) const override;
void printType(::mlir::Type type, ::mlir::DialectAsmPrinter &printer) const override;
}];
}
#endif

View File

@@ -28,25 +28,6 @@ void TFHEDialect::initialize() {
>();
}
::mlir::Type TFHEDialect::parseType(::mlir::DialectAsmParser &parser) const {
if (parser.parseOptionalKeyword("glwe").succeeded())
return GLWECipherTextType::parse(parser);
parser.emitError(parser.getCurrentLocation(), "Unknown TFHE type");
return ::mlir::Type();
}
void TFHEDialect::printType(::mlir::Type type,
::mlir::DialectAsmPrinter &printer) const {
mlir::concretelang::TFHE::GLWECipherTextType glwe =
type.dyn_cast_or_null<mlir::concretelang::TFHE::GLWECipherTextType>();
if (glwe != nullptr) {
glwe.print(printer);
return;
}
// TODO - What should be done here?
printer << "unknwontype";
}
/// Verify that GLWE parameter are consistant
/// - The bits parameter is 64 (we support only this for v0)
::mlir::LogicalResult GLWECipherTextType::verify(

View File

@@ -10,8 +10,7 @@ namespace concretelang {
namespace TFHE {
void GLWECipherTextType::print(mlir::AsmPrinter &p) const {
p << "glwe"
<< "<{";
p << "<{";
if (getDimension() == -1)
p << "_";
else