1 //===-- LLVMIR.h - C Interface for MLIR LLVMIR Target -------------*- C -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM
5 // See https://llvm.org/LICENSE.txt for license information.
6 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
8 //===----------------------------------------------------------------------===//
10 // This header declares the C interface to target LLVMIR with MLIR.
12 //===----------------------------------------------------------------------===//
14 #ifndef MLIR_C_TARGET_LLVMIR_H
15 #define MLIR_C_TARGET_LLVMIR_H
17 #include "mlir-c/IR.h"
18 #include "mlir-c/Support.h"
19 #include "llvm-c/Support.h"
25 /// Translate operation that satisfies LLVM dialect module requirements into an
26 /// LLVM IR module living in the given context. This translates operations from
27 /// any dilalect that has a registered implementation of
28 /// LLVMTranslationDialectInterface.
30 /// \returns the generated LLVM IR Module from the translated MLIR module, it is
31 /// owned by the caller.
32 MLIR_CAPI_EXPORTED LLVMModuleRef
33 mlirTranslateModuleToLLVMIR(MlirOperation module
, LLVMContextRef context
);
39 #endif // MLIR_C_TARGET_LLVMIR_H