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 2026 Project LLZK
6// SPDX-License-Identifier: Apache-2.0
8//===----------------------------------------------------------------------===//
13include "llzk/Dialect/POD/IR/Dialect.td"
15include "mlir/IR/AttrTypeBase.td"
16include "mlir/IR/BuiltinAttributeInterfaces.td"
17include "mlir/IR/EnumAttr.td"
19class PODDialectAttr<string name, string attrMnemonic, list<Trait> traits = []>
20 : AttrDef<PODDialect, name, traits> {
21 let mnemonic = attrMnemonic;
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);
30 let assemblyFormat = "`` custom<Record>($name, $type)";
32 let extraClassDeclaration = [{
33 /// Returns the record name as a symbol.
34 ::mlir::FlatSymbolRefAttr getNameSym() const;