13 #ifndef MLIR_TARGET_LLVMIR_LLVMTRANSLATIONINTERFACE_H
14 #define MLIR_TARGET_LLVMIR_LLVMTRANSLATIONINTERFACE_H
26 class ModuleTranslation;
74 return iface->convertOperation(op, builder, moduleTranslation);
85 return iface->amendOperation(op, attribute, moduleTranslation);
A collection of dialect interfaces within a context, for a given concrete interface type.
DialectInterfaceCollection< LLVMTranslationDialectInterface > Base
const LLVMTranslationDialectInterface * getInterfaceFor(Object *obj) const
Get the interface for a given object, or null if one is not registered.
Dialects are groups of MLIR operations, types and attributes, as well as behavior associated with the...
Base class for dialect interfaces providing translation to LLVM IR.
virtual LogicalResult amendOperation(Operation *op, NamedAttribute attribute, LLVM::ModuleTranslation &moduleTranslation) const
Hook for derived dialect interface to act on an operation that has dialect attributes from the derive...
virtual LogicalResult convertOperation(Operation *op, llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation) const
Hook for derived dialect interface to provide translation of the operations to LLVM IR.
LLVMTranslationDialectInterface(Dialect *dialect)
Interface collection for translation to LLVM IR, dispatches to a concrete interface implementation ba...
virtual LogicalResult convertOperation(Operation *op, llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation) const
Translates the given operation to LLVM IR using the interface implemented by the op's dialect.
virtual LogicalResult amendOperation(Operation *op, NamedAttribute attribute, LLVM::ModuleTranslation &moduleTranslation) const
Acts on the given operation using the interface implemented by the dialect of one of the operation's ...
Implementation class for module translation.
NamedAttribute represents a combination of a name and an Attribute value.
Dialect * getNameDialect() const
Return the dialect of the name of this attribute, if the name is prefixed by a dialect namespace.
Operation is the basic unit of execution within MLIR.
The base class used for all derived interface types.
Include the generated interface declarations.
Include the generated interface declarations.
LogicalResult failure(bool isFailure=true)
Utility function to generate a LogicalResult.
LogicalResult success(bool isSuccess=true)
Utility function to generate a LogicalResult.
This class represents an efficient way to signal success or failure.