LLZK 2.1.1
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"
17
18#include <mlir/CAPI/IR.h>
19#include <mlir/CAPI/Registration.h>
20
21using namespace llzk;
22using namespace llzk::cast;
23
24// Include the generated CAPI
26// Enums must come before Attrs and Ops
29
30MLIR_DEFINE_CAPI_DIALECT_REGISTRATION(Cast, llzk__cast, CastDialect)
31
33 Cast, IntToFeltOp, WithType, MlirType feltType, MlirValue value
34) {
35 return wrap(create<IntToFeltOp>(builder, location, unwrap(feltType), unwrap(value)));
36}
#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