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"
14include "llzk/Dialect/Function/IR/Attrs.td" // must be included to generate docs
16include "mlir/IR/AttrTypeBase.td"
18class FunctionDialectAttr<string name, string attrMnemonic,
19 list<Trait> traits = []>
20 : AttrDef<FunctionDialect, name, traits> {
21 let mnemonic = attrMnemonic;
24def LLZK_AllowConstraintAttr
25 : FunctionDialectAttr<"AllowConstraint", "allow_constraint"> {
27 "Marks functions to allow `ConstraintGen` ops within their body";
29 A unit attribute that can be attached to a `FuncDefOp` to indicate that ops
30 marked with `ConstraintGen` (e.g., emit ops) are allowed within its body.
34def LLZK_AllowWitnessAttr
35 : FunctionDialectAttr<"AllowWitness", "allow_witness"> {
36 let summary = "Marks functions to allow `WitnessGen` ops within their body";
38 A unit attribute that can be attached to a `FuncDefOp` to indicate that ops marked
39 with `WitnessGen` (e.g., construct and write ops) are allowed within its body.
43def LLZK_AllowNonNativeFieldOpsAttr
44 : FunctionDialectAttr<"AllowNonNativeFieldOps",
45 "allow_non_native_field_ops"> {
47 "Marks functions to allow `NotFieldNative` ops within their body";
49 A unit attribute that can be attached to a `FuncDefOp` to indicate that ops marked
50 with `NotFieldNative` (e.g., boolean and bitwise ops) are allowed within its body.
54#endif // LLZK_FUNCTION_ATTRS