mirror of
https://github.com/zama-ai/concrete.git
synced 2026-02-09 03:55:04 -05:00
cleanup(compiler): Remove custom print and parse TFHE types
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -10,8 +10,7 @@ namespace concretelang {
|
||||
namespace TFHE {
|
||||
|
||||
void GLWECipherTextType::print(mlir::AsmPrinter &p) const {
|
||||
p << "glwe"
|
||||
<< "<{";
|
||||
p << "<{";
|
||||
if (getDimension() == -1)
|
||||
p << "_";
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user