/*===- TableGen'erated file -------------------------------------*- C++ -*-===*\ |* *| |* Dialect Interface Declarations *| |* *| |* Automatically generated file, do not edit! *| |* *| \*===----------------------------------------------------------------------===*/ namespace mlir { /// Base class for dialect interfaces used to import LLVM IR. Dialects that can /// be imported should provide an implementation of this interface for the /// supported intrinsics. The interface may be implemented in a separate library /// to avoid the "main" dialect library depending on LLVM IR. The interface can /// be attached using the delayed registration mechanism available in /// DialectRegistry. class LLVMImportDialectInterface : public ::mlir::DialectInterface::Base { public: /// Hook for derived dialect interfaces to implement the import of /// intrinsics into MLIR. virtual ::llvm::LogicalResult convertIntrinsic(::mlir::OpBuilder & builder, ::llvm::CallInst * inst, ::mlir::LLVM::ModuleImport & moduleImport) const { return ::llvm::failure(); } /// Hook for derived dialect interfaces to implement the import of /// instructions into MLIR. virtual ::llvm::LogicalResult convertInstruction(::mlir::OpBuilder & builder, ::llvm::Instruction * inst, ::mlir::ArrayRef llvmOperands, ::mlir::LLVM::ModuleImport & moduleImport) const { return ::llvm::failure(); } /// Hook for derived dialect interfaces to implement the import of metadata /// into MLIR. Attaches the converted metadata kind and node to the provided /// operation. virtual ::mlir::LogicalResult setMetadataAttrs(::mlir::OpBuilder & builder, unsigned kind, ::llvm::MDNode * node, ::mlir::Operation * op, ::mlir::LLVM::ModuleImport & moduleImport) const { return ::llvm::failure(); } /// Hook for derived dialect interfaces to publish the supported intrinsics. /// As every LLVM IR intrinsic has a unique integer identifier, the function /// returns the list of supported intrinsic identifiers. virtual ::mlir::ArrayRef getSupportedIntrinsics() const { return {}; } /// Hook for derived dialect interfaces to publish the supported instructions. /// As every LLVM IR instruction has a unique integer identifier, the function /// returns the list of supported instruction identifiers. These identifiers /// will then be used to match LLVM instructions to the appropriate import /// interface and `convertInstruction` method. It is an error to have multiple /// interfaces overriding the same instruction. virtual ::mlir::ArrayRef getSupportedInstructions() const { return {}; } /// Hook for derived dialect interfaces to publish the supported metadata /// kinds. As every metadata kind has a unique integer identifier, the /// function returns the list of supported metadata identifiers. The /// `llvmContext` parameter is used to obtain identifiers for metadata kinds /// that do not have a fixed static identifier. Since different LLVM contexts /// can assign different identifiers to these non-static metadata kinds, the /// function must recompute the list of supported metadata identifiers on each /// call. virtual ::mlir::SmallVector getSupportedMetadata(::llvm::LLVMContext & llvmContext) const { return {}; } LLVMImportDialectInterface(::mlir::Dialect *dialect) : Base(dialect) {} }; } // namespace mlir