Files
gps/tools/local/circt/include/mlir/Target/LLVMIR/LLVMTranslationDialectInterface.h.inc
T
2026-07-12 11:01:51 +03:00

47 lines
2.6 KiB
C++

/*===- TableGen'erated file -------------------------------------*- C++ -*-===*\
|* *|
|* Dialect Interface Declarations *|
|* *|
|* Automatically generated file, do not edit! *|
|* *|
\*===----------------------------------------------------------------------===*/
namespace mlir {
/// Base class for dialect interfaces providing translation to LLVM IR.
/// Dialects that can be translated should provide an implementation of this
/// interface for the supported operations. 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 LLVMTranslationDialectInterface : public ::mlir::DialectInterface::Base<LLVMTranslationDialectInterface> {
public:
/// Hook for derived dialect interface to provide translation of the
/// operations to LLVM IR.
virtual ::mlir::LogicalResult convertOperation(::mlir::Operation * op, ::llvm::IRBuilderBase & builder, ::mlir::LLVM::ModuleTranslation & moduleTranslation) const {
return ::llvm::failure();
}
/// Hook for derived dialect interface to act on an operation that has dialect
/// attributes from the derived dialect (the operation itself may be from a
/// different dialect). This gets called after the operation has been
/// translated. The hook is expected to use moduleTranslation to look up the
/// translation results and amend the corresponding IR constructs. Does
/// nothing and succeeds by default.
virtual ::mlir::LogicalResult amendOperation(::mlir::Operation * op, ::mlir::ArrayRef<::llvm::Instruction *> instructions, ::mlir::NamedAttribute attribute, ::mlir::LLVM::ModuleTranslation & moduleTranslation) const {
return ::llvm::success();
}
/// Hook for derived dialect interface to translate or act on a derived
/// dialect attribute that appears on a function parameter. This gets called
/// after the function operation has been translated.
virtual ::mlir::LogicalResult convertParameterAttr(::mlir::LLVM::LLVMFuncOp function, int argIdx, ::mlir::NamedAttribute attr, ::mlir::LLVM::ModuleTranslation & moduleTranslation) const {
return ::llvm::success();
}
LLVMTranslationDialectInterface(::mlir::Dialect *dialect) : Base(dialect) {}
};
} // namespace mlir