LLZK 0.1.0
An open-source IR for Zero Knowledge (ZK) circuits
Loading...
Searching...
No Matches
Attrs.td
Go to the documentation of this file.
1//===-- Attrs.td -------------------------------------------*- tablegen -*-===//
2//
3// Part of the LLZK Project, under the Apache License v2.0.
4// See LICENSE.txt for license information.
5// Copyright 2026 Project LLZK
6// SPDX-License-Identifier: Apache-2.0
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef POD_ATTRS
11#define POD_ATTRS
12
13include "llzk/Dialect/POD/IR/Dialect.td"
14
15include "mlir/IR/AttrTypeBase.td"
16include "mlir/IR/BuiltinAttributeInterfaces.td"
17include "mlir/IR/EnumAttr.td"
18
19class PODDialectAttr<string name, string attrMnemonic, list<Trait> traits = []>
20 : AttrDef<PODDialect, name, traits> {
21 let mnemonic = attrMnemonic;
22}
23
24def LLZK_RecordAttr : PODDialectAttr<"Record", "record"> {
25 let summary = "A named entry in a plain-old-data struct";
26 let parameters = (ins AttrParameter<"::mlir::StringAttr",
27 "Name of the record entry.">:$name,
28 AttrParameter<"::mlir::Type", "Type of the record entry.">:$type);
29
30 let assemblyFormat = "`` custom<Record>($name, $type)";
31
32 let extraClassDeclaration = [{
33 /// Returns the record name as a symbol.
34 ::mlir::FlatSymbolRefAttr getNameSym() const;
35 }];
36}
37
38#endif // POD_ATTRS