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"> {
25 let summary = "Marks functions to allow `ConstraintGen` ops";
27 A unit attribute that can be attached to a `FuncDefOp` to indicate that ops
28 marked with `ConstraintGen` (ex: emit ops) are allowed within its body.
32def LLZK_AllowWitnessAttr
33 : FunctionDialectAttr<"AllowWitness", "allow_witness"> {
34 let summary = "Marks functions to allow `WitnessGen` ops";
36 A unit attribute that can be attached to a `FuncDefOp` to indicate that ops
37 marked with `WitnessGen` (i.e. boolean and bitwise ops) are allowed within its body.
41#endif // LLZK_FUNCTION_ATTRS