LLZK 0.1.0
Veridise's ZK Language IR
Loading...
Searching...
No Matches
Felt.cpp
Go to the documentation of this file.
1//===-- Felt.cpp - Felt dialect C API implementation ------------*- C++ -*-===//
2//
3// Part of the LLZK Project, under the Apache License v2.0.
4// See LICENSE.txt for license information.
5// Copyright 2025 Veridise Inc.
6// SPDX-License-Identifier: Apache-2.0
7//
8//===----------------------------------------------------------------------===//
9
14
15#include "llzk-c/Dialect/Felt.h"
16
17#include <mlir/CAPI/Registration.h>
18#include <mlir/CAPI/Wrap.h>
19
20using namespace llzk::felt;
21
23
24MlirAttribute llzkFeltConstAttrGet(MlirContext ctx, int64_t value) {
25 return wrap(FeltConstAttr::get(unwrap(ctx), llzk::toAPInt(value)));
26}
27
28bool llzkAttributeIsAFeltConstAttr(MlirAttribute attr) {
29 return mlir::isa<FeltConstAttr>(unwrap(attr));
30}
31
32MlirType llzkFeltTypeGet(MlirContext ctx) { return wrap(FeltType::get(unwrap(ctx))); }
33
34bool llzkTypeIsAFeltType(MlirType type) { return mlir::isa<FeltType>(unwrap(type)); }
MlirAttribute llzkFeltConstAttrGet(MlirContext ctx, int64_t value)
Creates a llzk::felt::FeltConstAttr.
Definition Felt.cpp:24
MlirType llzkFeltTypeGet(MlirContext ctx)
Creates a llzk::felt::FeltType.
Definition Felt.cpp:32
bool llzkTypeIsAFeltType(MlirType type)
Definition Felt.cpp:34
bool llzkAttributeIsAFeltConstAttr(MlirAttribute attr)
Definition Felt.cpp:28
MLIR_DEFINE_CAPI_DIALECT_REGISTRATION(Polymorphic, llzk__polymorphic, llzk::polymorphic::PolymorphicDialect) MlirType llzkTypeVarTypeGet(MlirContext ctx
::llzk::felt::FeltType get(::mlir::MLIRContext *context)
Definition Types.h.inc:23
llvm::APInt toAPInt(int64_t i)