1//===-- Attrs.td -------------------------------------------*- tablegen -*-===//
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
8//===----------------------------------------------------------------------===//
10#ifndef LLZK_FUNCTION_ATTRS
11#define LLZK_FUNCTION_ATTRS
13include "llzk/Dialect/Function/IR/Dialect.td"
15include "mlir/IR/AttrTypeBase.td"
17class FunctionDialectAttr<string name, string attrMnemonic,
18 list<Trait> traits = []>
19 : AttrDef<FunctionDialect, name, traits> {
20 let mnemonic = attrMnemonic;
23def LLZK_AllowConstraintAttr
24 : FunctionDialectAttr<"AllowConstraint", "allow_constraint"> {
26 "Marks functions to allow `ConstraintGen` ops within their body";
28 A unit attribute that can be attached to a `FuncDefOp` to indicate that ops
29 marked with `ConstraintGen` (e.g., emit ops) are allowed within its body.
33def LLZK_AllowWitnessAttr
34 : FunctionDialectAttr<"AllowWitness", "allow_witness"> {
35 let summary = "Marks functions to allow `WitnessGen` ops within their body";
37 A unit attribute that can be attached to a `FuncDefOp` to indicate that ops marked
38 with `WitnessGen` (e.g., construct and write ops) are allowed within its body.
42def LLZK_AllowNonNativeFieldOpsAttr
43 : FunctionDialectAttr<"AllowNonNativeFieldOps",
44 "allow_non_native_field_ops"> {
46 "Marks functions to allow `NotFieldNative` ops within their body";
48 A unit attribute that can be attached to a `FuncDefOp` to indicate that ops marked
49 with `NotFieldNative` (e.g., boolean and bitwise ops) are allowed within its body.
53#endif // LLZK_FUNCTION_ATTRS