123aa5a74SRiver Riddle //===-- mlir-c/Dialect/Func.h - C API for Func dialect ------------*- C -*-===// 223aa5a74SRiver Riddle // 323aa5a74SRiver Riddle // Part of the LLVM Project, under the Apache License v2.0 with LLVM 423aa5a74SRiver Riddle // Exceptions. 523aa5a74SRiver Riddle // See https://llvm.org/LICENSE.txt for license information. 623aa5a74SRiver Riddle // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 723aa5a74SRiver Riddle // 823aa5a74SRiver Riddle //===----------------------------------------------------------------------===// 923aa5a74SRiver Riddle // 1023aa5a74SRiver Riddle // This header declares the C interface for registering and accessing the 1123aa5a74SRiver Riddle // Func dialect. A dialect should be registered with a context to make it 1223aa5a74SRiver Riddle // available to users of the context. These users must load the dialect 1323aa5a74SRiver Riddle // before using any of its attributes, operations or types. Parser and pass 1423aa5a74SRiver Riddle // manager can load registered dialects automatically. 1523aa5a74SRiver Riddle // 1623aa5a74SRiver Riddle //===----------------------------------------------------------------------===// 1723aa5a74SRiver Riddle 1823aa5a74SRiver Riddle #ifndef MLIR_C_DIALECT_FUNC_H 1923aa5a74SRiver Riddle #define MLIR_C_DIALECT_FUNC_H 2023aa5a74SRiver Riddle 21*86bc2e3aSAdam Paszke #include <stdint.h> 22*86bc2e3aSAdam Paszke 235e83a5b4SStella Laurenzo #include "mlir-c/IR.h" 24*86bc2e3aSAdam Paszke #include "mlir-c/Support.h" 2523aa5a74SRiver Riddle 2623aa5a74SRiver Riddle #ifdef __cplusplus 2723aa5a74SRiver Riddle extern "C" { 2823aa5a74SRiver Riddle #endif 2923aa5a74SRiver Riddle 3023aa5a74SRiver Riddle MLIR_DECLARE_CAPI_DIALECT_REGISTRATION(Func, func); 3123aa5a74SRiver Riddle 32*86bc2e3aSAdam Paszke /// Sets the argument attribute 'name' of an argument at index 'pos'. 33*86bc2e3aSAdam Paszke /// Asserts that the operation is a FuncOp. 34*86bc2e3aSAdam Paszke MLIR_CAPI_EXPORTED void mlirFuncSetArgAttr(MlirOperation op, intptr_t pos, 35*86bc2e3aSAdam Paszke MlirStringRef name, 36*86bc2e3aSAdam Paszke MlirAttribute attr); 37*86bc2e3aSAdam Paszke 3823aa5a74SRiver Riddle #ifdef __cplusplus 3923aa5a74SRiver Riddle } 4023aa5a74SRiver Riddle #endif 4123aa5a74SRiver Riddle 4223aa5a74SRiver Riddle #endif // MLIR_C_DIALECT_FUNC_H 43