1 //===-- mlir-c/Dialect/LLVM.h - C API for LLVM --------------------*- 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 #ifndef MLIR_C_DIALECT_LLVM_H
11 #define MLIR_C_DIALECT_LLVM_H
13 #include "mlir-c/IR.h"
19 MLIR_DECLARE_CAPI_DIALECT_REGISTRATION(LLVM
, llvm
);
21 /// Creates an llvm.ptr type.
22 MLIR_CAPI_EXPORTED MlirType
mlirLLVMPointerTypeGet(MlirContext ctx
,
23 unsigned addressSpace
);
25 /// Creates an llmv.void type.
26 MLIR_CAPI_EXPORTED MlirType
mlirLLVMVoidTypeGet(MlirContext ctx
);
28 /// Creates an llvm.array type.
29 MLIR_CAPI_EXPORTED MlirType
mlirLLVMArrayTypeGet(MlirType elementType
,
30 unsigned numElements
);
32 /// Creates an llvm.func type.
33 MLIR_CAPI_EXPORTED MlirType
34 mlirLLVMFunctionTypeGet(MlirType resultType
, intptr_t nArgumentTypes
,
35 MlirType
const *argumentTypes
, bool isVarArg
);
37 /// Creates an LLVM literal (unnamed) struct type.
38 MLIR_CAPI_EXPORTED MlirType
39 mlirLLVMStructTypeLiteralGet(MlirContext ctx
, intptr_t nFieldTypes
,
40 MlirType
const *fieldTypes
, bool isPacked
);
46 #endif // MLIR_C_DIALECT_LLVM_H