Changeset View
Changeset View
Standalone View
Standalone View
mlir/include/mlir/Target/LLVMIR/LLVMTranslationInterface.h
Show First 20 Lines • Show All 76 Lines • ▼ Show 20 Lines | public: | ||||
} | } | ||||
/// Acts on the given operation using the interface implemented by the dialect | /// Acts on the given operation using the interface implemented by the dialect | ||||
/// of one of the operation's dialect attributes. | /// of one of the operation's dialect attributes. | ||||
virtual LogicalResult | virtual LogicalResult | ||||
amendOperation(Operation *op, NamedAttribute attribute, | amendOperation(Operation *op, NamedAttribute attribute, | ||||
LLVM::ModuleTranslation &moduleTranslation) const { | LLVM::ModuleTranslation &moduleTranslation) const { | ||||
if (const LLVMTranslationDialectInterface *iface = | if (const LLVMTranslationDialectInterface *iface = | ||||
getInterfaceFor(attribute.first.getDialect())) { | getInterfaceFor(attribute.first.getReferencedDialect())) { | ||||
return iface->amendOperation(op, attribute, moduleTranslation); | return iface->amendOperation(op, attribute, moduleTranslation); | ||||
} | } | ||||
return success(); | return success(); | ||||
} | } | ||||
}; | }; | ||||
} // namespace mlir | } // namespace mlir | ||||
#endif // MLIR_TARGET_LLVMIR_LLVMTRANSLATIONINTERFACE_H | #endif // MLIR_TARGET_LLVMIR_LLVMTRANSLATIONINTERFACE_H |