LLZK 2.0.0
An open-source IR for Zero Knowledge (ZK) circuits
Loading...
Searching...
No Matches
Cast.cpp
Go to the documentation of this file.
1//===-- Cast.cpp - Cast 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
10#include "llzk-c/Dialect/Cast.h"
11
12#include "llzk/CAPI/Builder.h"
13#include "llzk/CAPI/Support.h"
16
17#include <mlir/CAPI/IR.h>
18#include <mlir/CAPI/Registration.h>
19
20using namespace llzk;
21using namespace llzk::cast;
22
23// Include the generated CAPI
25
26MLIR_DEFINE_CAPI_DIALECT_REGISTRATION(Cast, llzk__cast, CastDialect)
27
29 Cast, IntToFeltOp, WithType, MlirType feltType, MlirValue value
30) {
31 return wrap(create<IntToFeltOp>(builder, location, unwrap(feltType), unwrap(value)));
32}
#define LLZK_DEFINE_SUFFIX_OP_BUILD_METHOD(dialect, op, suffix,...)
Definition Support.h:27
mlir::Operation * create(MlirOpBuilder cBuilder, MlirLocation cLocation, Args &&...args)
Creates a new operation using an ODS build method.
Definition Builder.h:41