MLIR 22.0.0git
Func.cpp
Go to the documentation of this file.
1//===- Func.cpp - C Interface for Func dialect ----------------------------===//
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
10#include "mlir-c/IR.h"
11#include "mlir-c/Support.h"
14
15MLIR_DEFINE_CAPI_DIALECT_REGISTRATION(Func, func, mlir::func::FuncDialect)
16
17void mlirFuncSetArgAttr(MlirOperation op, intptr_t pos, MlirStringRef name,
18 MlirAttribute attr) {
19 llvm::cast<mlir::func::FuncOp>(unwrap(op))
20 .setArgAttr(pos, unwrap(name), unwrap(attr));
21}
22
23void mlirFuncSetResultAttr(MlirOperation op, intptr_t pos, MlirStringRef name,
24 MlirAttribute attr) {
25 llvm::cast<mlir::func::FuncOp>(unwrap(op))
26 .setResultAttr(pos, unwrap(name), unwrap(attr));
27}
void mlirFuncSetResultAttr(MlirOperation op, intptr_t pos, MlirStringRef name, MlirAttribute attr)
Definition Func.cpp:23
MLIR_CAPI_EXPORTED void mlirFuncSetArgAttr(MlirOperation op, intptr_t pos, MlirStringRef name, MlirAttribute attr)
Sets the argument attribute 'name' of an argument at index 'pos'.
Definition Func.cpp:17
#define MLIR_DEFINE_CAPI_DIALECT_REGISTRATION(Name, Namespace, ClassName)
mlir::Diagnostic & unwrap(MlirDiagnostic diagnostic)
Definition Diagnostics.h:19
A pointer to a sized fragment of a string, not necessarily null-terminated.
Definition Support.h:73