diff options
Diffstat (limited to 'mlir/lib/CAPI/Dialect/LLVM.cpp')
-rw-r--r-- | mlir/lib/CAPI/Dialect/LLVM.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/mlir/lib/CAPI/Dialect/LLVM.cpp b/mlir/lib/CAPI/Dialect/LLVM.cpp index 6ed82ba..da450dd 100644 --- a/mlir/lib/CAPI/Dialect/LLVM.cpp +++ b/mlir/lib/CAPI/Dialect/LLVM.cpp @@ -55,6 +55,16 @@ MlirType mlirLLVMFunctionTypeGet(MlirType resultType, intptr_t nArgumentTypes, unwrapList(nArgumentTypes, argumentTypes, argumentStorage), isVarArg)); } +intptr_t mlirLLVMFunctionTypeGetNumInputs(MlirType type) { + return llvm::cast<LLVM::LLVMFunctionType>(unwrap(type)).getNumParams(); +} + +MlirType mlirLLVMFunctionTypeGetInput(MlirType type, intptr_t pos) { + assert(pos >= 0 && "pos in array must be positive"); + return wrap(llvm::cast<LLVM::LLVMFunctionType>(unwrap(type)) + .getParamType(static_cast<unsigned>(pos))); +} + bool mlirTypeIsALLVMStructType(MlirType type) { return isa<LLVM::LLVMStructType>(unwrap(type)); } |