LLZK
3.0.0
An open-source IR for Zero Knowledge (ZK) circuits
Toggle main menu visibility
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
18
using namespace
mlir
;
19
using namespace
llvm
;
20
21
bool
llzkAttributeIsA_Felt_FeltConstAttr
(MlirAttribute inp) {
22
return
llvm::isa<FeltConstAttr>(unwrap(inp));
23
}
24
25
MlirAttribute
llzkFelt_FeltConstAttrGet
(MlirContext ctx, MlirStringRef rawValue, MlirType type) {
26
auto
rawValueInteger =
llzk::parseDynamicAPInt
(unwrap(rawValue));
27
if
(!rawValueInteger) { mlir::emitError(mlir::UnknownLoc::get(unwrap(ctx)), llvm::toString(rawValueInteger.takeError()));
return
{
nullptr
}; }
28
29
return
wrap(FeltConstAttr::get(unwrap(ctx), *rawValueInteger, ::llvm::cast<FeltType>(unwrap(type))));
30
}
31
32
void
llzkFelt_FeltConstAttrGetRawValue
(MlirAttribute inp, MlirStringCallback callback,
void
*userData) {
33
std::string text;
34
llvm::raw_string_ostream(text) << llvm::cast<FeltConstAttr>(unwrap(inp)).getRawValue();
35
callback(wrap(llvm::StringRef(text)), userData);
36
}
37
38
MlirType
llzkFelt_FeltConstAttrGetType
(MlirAttribute inp) {
39
return
wrap(llvm::cast<FeltConstAttr>(unwrap(inp)).getType());
40
}
41
42
MlirIdentifier
llzkFelt_FeltConstAttrGetFieldName
(MlirAttribute inp) {
43
return
wrap(llvm::cast<FeltConstAttr>(unwrap(inp)).getFieldName());
44
}
45
46
void
llzkFelt_FeltConstAttrGetReducedValueOrRaw
(MlirAttribute inp, MlirStringCallback callback,
void
*userData) {
47
std::string text;
48
llvm::raw_string_ostream(text) << llvm::cast<FeltConstAttr>(unwrap(inp)).getReducedValueOrRaw();
49
callback(wrap(llvm::StringRef(text)), userData);
50
}
51
52
bool
llzkAttributeIsA_Felt_FieldSpecAttr
(MlirAttribute inp) {
53
return
llvm::isa<FieldSpecAttr>(unwrap(inp));
54
}
55
56
MlirAttribute
llzkFelt_FieldSpecAttrGet
(MlirContext ctx, MlirIdentifier fieldName, MlirStringRef prime) {
57
auto
primeInteger =
llzk::parseDynamicAPInt
(unwrap(prime));
58
if
(!primeInteger) { mlir::emitError(mlir::UnknownLoc::get(unwrap(ctx)), llvm::toString(primeInteger.takeError()));
return
{
nullptr
}; }
59
60
return
wrap(FieldSpecAttr::getChecked(mlir::UnknownLoc::get(unwrap(ctx)), unwrap(ctx), unwrap(fieldName), *primeInteger));
61
}
62
63
MlirIdentifier
llzkFelt_FieldSpecAttrGetFieldName
(MlirAttribute inp) {
64
return
wrap(llvm::cast<FieldSpecAttr>(unwrap(inp)).getFieldName());
65
}
66
67
void
llzkFelt_FieldSpecAttrGetPrime
(MlirAttribute inp, MlirStringCallback callback,
void
*userData) {
68
std::string text;
69
llvm::raw_string_ostream(text) << llvm::cast<FieldSpecAttr>(unwrap(inp)).getPrime();
70
callback(wrap(llvm::StringRef(text)), userData);
71
}
llzkFelt_FeltConstAttrGetType
MlirType llzkFelt_FeltConstAttrGetType(MlirAttribute inp)
Get 'type' parameter from a llzk::felt::FeltConstAttr Attribute.
Definition
Attrs.capi.cpp.inc:38
llzkAttributeIsA_Felt_FieldSpecAttr
bool llzkAttributeIsA_Felt_FieldSpecAttr(MlirAttribute inp)
Returns true if the Attribute is a llzk::felt::FieldSpecAttr.
Definition
Attrs.capi.cpp.inc:52
llzkAttributeIsA_Felt_FeltConstAttr
bool llzkAttributeIsA_Felt_FeltConstAttr(MlirAttribute inp)
Returns true if the Attribute is a llzk::felt::FeltConstAttr.
Definition
Attrs.capi.cpp.inc:21
llzkFelt_FieldSpecAttrGetPrime
void llzkFelt_FieldSpecAttrGetPrime(MlirAttribute inp, MlirStringCallback callback, void *userData)
Print the exact signed decimal 'prime' value. The callback must copy the text to retain it.
Definition
Attrs.capi.cpp.inc:67
llzkFelt_FieldSpecAttrGet
MlirAttribute llzkFelt_FieldSpecAttrGet(MlirContext ctx, MlirIdentifier fieldName, MlirStringRef prime)
Create a llzk::felt::FieldSpecAttr Attribute with the given parameters.
Definition
Attrs.capi.cpp.inc:56
llzkFelt_FeltConstAttrGetFieldName
MlirIdentifier llzkFelt_FeltConstAttrGetFieldName(MlirAttribute inp)
Returns the field name from the stored FeltType, or a null StringAttr if no type is stored.
Definition
Attrs.capi.cpp.inc:42
llzkFelt_FieldSpecAttrGetFieldName
MlirIdentifier llzkFelt_FieldSpecAttrGetFieldName(MlirAttribute inp)
Get 'fieldName' parameter from a llzk::felt::FieldSpecAttr Attribute.
Definition
Attrs.capi.cpp.inc:63
llzkFelt_FeltConstAttrGet
MlirAttribute llzkFelt_FeltConstAttrGet(MlirContext ctx, MlirStringRef rawValue, MlirType type)
Create a llzk::felt::FeltConstAttr Attribute with the given parameters.
Definition
Attrs.capi.cpp.inc:25
llzkFelt_FeltConstAttrGetRawValue
void llzkFelt_FeltConstAttrGetRawValue(MlirAttribute inp, MlirStringCallback callback, void *userData)
Print the exact signed decimal 'rawValue' value. The callback must copy the text to retain it.
Definition
Attrs.capi.cpp.inc:32
llzkFelt_FeltConstAttrGetReducedValueOrRaw
void llzkFelt_FeltConstAttrGetReducedValueOrRaw(MlirAttribute inp, MlirStringCallback callback, void *userData)
If the type specifies a field, returns getReducedValue(); otherwise getRawValue().
Definition
Attrs.capi.cpp.inc:46
llvm
Definition
SourceRefLattice.cpp:411
llzk::parseDynamicAPInt
Expected< DynamicAPInt > parseDynamicAPInt(StringRef str)
Definition
DynamicAPIntHelper.cpp:48
mlir
Definition
CommonCAPIGen.h:50
build
include
llzk
Dialect
Felt
IR
Attrs.capi.cpp.inc
Generated by
1.17.0
Copyright 2025 Veridise Inc. under the Apache License v2.0. Copyright 2026 Project LLZK under the Apache License v2.0.