LLZK 3.0.0
An open-source IR for Zero Knowledge (ZK) circuits
Loading...
Searching...
No Matches
Attrs.capi.cpp.inc
Go to the documentation of this file.
1/*===- TableGen'erated file -------------------------------------*- C++ -*-===*\
2|* *|
3|* Attr C API Implementations *|
4|* *|
5|* Automatically generated file, do not edit! *|
6|* From: Attrs.td *|
7|* *|
8\*===----------------------------------------------------------------------===*/
9
10
11#include <mlir/IR/Diagnostics.h>
12#include <mlir/IR/BuiltinAttributes.h>
13#include <mlir/CAPI/IR.h>
14#include <mlir/CAPI/Support.h>
15#include <llvm/ADT/TypeSwitch.h>
16#include <utility>
17
18using namespace mlir;
19using namespace llvm;
20
21bool llzkAttributeIsA_Llzk_LoopBoundsAttr(MlirAttribute inp) {
22 return llvm::isa<LoopBoundsAttr>(unwrap(inp));
23}
24
25MlirAttribute llzkLlzk_LoopBoundsAttrGet(MlirContext ctx, MlirStringRef lower, MlirStringRef upper, MlirStringRef step) {
26 auto lowerInteger = llzk::parseDynamicAPInt(unwrap(lower));
27if (!lowerInteger) { mlir::emitError(mlir::UnknownLoc::get(unwrap(ctx)), llvm::toString(lowerInteger.takeError())); return {nullptr}; }
28auto upperInteger = llzk::parseDynamicAPInt(unwrap(upper));
29if (!upperInteger) { mlir::emitError(mlir::UnknownLoc::get(unwrap(ctx)), llvm::toString(upperInteger.takeError())); return {nullptr}; }
30auto stepInteger = llzk::parseDynamicAPInt(unwrap(step));
31if (!stepInteger) { mlir::emitError(mlir::UnknownLoc::get(unwrap(ctx)), llvm::toString(stepInteger.takeError())); return {nullptr}; }
32
33 return wrap(LoopBoundsAttr::get(unwrap(ctx), *lowerInteger, *upperInteger, *stepInteger));
34}
35
36void llzkLlzk_LoopBoundsAttrGetLower(MlirAttribute inp, MlirStringCallback callback, void *userData) {
37 std::string text;
38 llvm::raw_string_ostream(text) << llvm::cast<LoopBoundsAttr>(unwrap(inp)).getLower();
39 callback(wrap(llvm::StringRef(text)), userData);
40}
41
42void llzkLlzk_LoopBoundsAttrGetUpper(MlirAttribute inp, MlirStringCallback callback, void *userData) {
43 std::string text;
44 llvm::raw_string_ostream(text) << llvm::cast<LoopBoundsAttr>(unwrap(inp)).getUpper();
45 callback(wrap(llvm::StringRef(text)), userData);
46}
47
48void llzkLlzk_LoopBoundsAttrGetStep(MlirAttribute inp, MlirStringCallback callback, void *userData) {
49 std::string text;
50 llvm::raw_string_ostream(text) << llvm::cast<LoopBoundsAttr>(unwrap(inp)).getStep();
51 callback(wrap(llvm::StringRef(text)), userData);
52}
53
54bool llzkAttributeIsA_Llzk_PublicAttr(MlirAttribute inp) {
55 return llvm::isa<PublicAttr>(unwrap(inp));
56}
57
58MlirAttribute llzkLlzk_PublicAttrGet(MlirContext ctx) {
59
60 return wrap(PublicAttr::get(unwrap(ctx)));
61}
62
bool llzkAttributeIsA_Llzk_LoopBoundsAttr(MlirAttribute inp)
Returns true if the Attribute is a llzk::LoopBoundsAttr.
void llzkLlzk_LoopBoundsAttrGetLower(MlirAttribute inp, MlirStringCallback callback, void *userData)
Print the exact signed decimal 'lower' value. The callback must copy the text to retain it.
MlirAttribute llzkLlzk_PublicAttrGet(MlirContext ctx)
Create a llzk::PublicAttr Attribute with the given parameters.
void llzkLlzk_LoopBoundsAttrGetStep(MlirAttribute inp, MlirStringCallback callback, void *userData)
Print the exact signed decimal 'step' value. The callback must copy the text to retain it.
bool llzkAttributeIsA_Llzk_PublicAttr(MlirAttribute inp)
Returns true if the Attribute is a llzk::PublicAttr.
MlirAttribute llzkLlzk_LoopBoundsAttrGet(MlirContext ctx, MlirStringRef lower, MlirStringRef upper, MlirStringRef step)
Create a llzk::LoopBoundsAttr Attribute with the given parameters.
void llzkLlzk_LoopBoundsAttrGetUpper(MlirAttribute inp, MlirStringCallback callback, void *userData)
Print the exact signed decimal 'upper' value. The callback must copy the text to retain it.
Expected< DynamicAPInt > parseDynamicAPInt(StringRef str)