1//===- Export.h - MLIR to LLVM IR translation entry point -------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef MLIR_TARGET_LLVMIR_EXPORT_H
10#define MLIR_TARGET_LLVMIR_EXPORT_H
11
12#include "llvm/ADT/StringRef.h"
13#include <memory>
14
15namespace llvm {
16class LLVMContext;
17class Module;
18} // namespace llvm
19
20namespace mlir {
21class Operation;
22
23/// Translate operation that satisfies LLVM dialect module requirements into an
24/// LLVM IR module living in the given context. This translates operations from
25/// any dilalect that has a registered implementation of
26/// LLVMTranslationDialectInterface.
27std::unique_ptr<llvm::Module>
28translateModuleToLLVMIR(Operation *module, llvm::LLVMContext &llvmContext,
29 llvm::StringRef name = "LLVMDialectModule");
30} // namespace mlir
31
32#endif // MLIR_TARGET_LLVMIR_EXPORT_H
33

source code of mlir/include/mlir/Target/LLVMIR/Export.h