70 lines
3.5 KiB
C++
70 lines
3.5 KiB
C++
/*===- TableGen'erated file -------------------------------------*- C++ -*-===*\
|
|
|* *|
|
|
|* Dialect Interface Declarations *|
|
|
|* *|
|
|
|* Automatically generated file, do not edit! *|
|
|
|* *|
|
|
\*===----------------------------------------------------------------------===*/
|
|
|
|
namespace mlir {
|
|
|
|
class BytecodeDialectInterface : public ::mlir::DialectInterface::Base<BytecodeDialectInterface> {
|
|
public:
|
|
|
|
/// Read an attribute belonging to this dialect from the given reader. This
|
|
/// method should return null in the case of failure. Optionally, the dialect
|
|
/// version can be accessed through the reader.
|
|
virtual ::mlir::Attribute readAttribute(::mlir::DialectBytecodeReader & reader) const {
|
|
reader.emitError() << "dialect " << getDialect()->getNamespace()
|
|
<< " does not support reading attributes from bytecode";
|
|
return ::mlir::Attribute();
|
|
}
|
|
|
|
/// Read a type belonging to this dialect from the given reader. This method
|
|
/// should return null in the case of failure. Optionally, the dialect version
|
|
/// can be accessed thorugh the reader.
|
|
virtual ::mlir::Type readType(::mlir::DialectBytecodeReader & reader) const {
|
|
reader.emitError() << "dialect " << getDialect()->getNamespace()
|
|
<< " does not support reading types from bytecode";
|
|
return ::mlir::Type();
|
|
}
|
|
|
|
/// Write the given attribute, which belongs to this dialect, to the given
|
|
/// writer. This method may return failure to indicate that the given
|
|
/// attribute could not be encoded, in which case the textual format will be
|
|
/// used to encode this attribute instead.
|
|
virtual ::llvm::LogicalResult writeAttribute(::mlir::Attribute attribute, ::mlir::DialectBytecodeWriter & writer) const {
|
|
return ::llvm::failure();
|
|
}
|
|
|
|
/// Write the given type, which belongs to this dialect, to the given writer.
|
|
/// This method may return failure to indicate that the given type could not
|
|
/// be encoded, in which case the textual format will be used to encode this
|
|
/// type instead.
|
|
virtual ::llvm::LogicalResult writeType(::mlir::Type type, ::mlir::DialectBytecodeWriter & writer) const {
|
|
return ::llvm::failure();
|
|
}
|
|
|
|
/// Write the version of this dialect to the given writer.
|
|
virtual void writeVersion(::mlir::DialectBytecodeWriter & writer) const {}
|
|
|
|
/// Read the version of this dialect from the provided reader and return it as
|
|
/// a `unique_ptr` to a dialect version object.
|
|
virtual std::unique_ptr<::mlir::DialectVersion> readVersion(::mlir::DialectBytecodeReader & reader) const {
|
|
reader.emitError("Dialect does not support versioning");
|
|
return nullptr;
|
|
}
|
|
|
|
/// Hook invoked after parsing completed, if a version directive was present
|
|
/// and included an entry for the current dialect. This hook offers the
|
|
/// opportunity to the dialect to visit the IR and upgrades constructs emitted
|
|
/// by the version of the dialect corresponding to the provided version.
|
|
virtual ::llvm::LogicalResult upgradeFromVersion(::mlir::Operation * topLevelOp, const ::mlir::DialectVersion & version) const {
|
|
return ::llvm::success();
|
|
}
|
|
|
|
BytecodeDialectInterface(::mlir::Dialect *dialect) : Base(dialect) {}
|
|
};
|
|
|
|
} // namespace mlir
|