LLZK 0.1.0
An open-source IR for Zero Knowledge (ZK) circuits
Loading...
Searching...
No Matches
Attrs.cpp
Go to the documentation of this file.
1//===-- Attrs.cpp - POD attributes implementation ---------------*- C++ -*-===//
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
11
12#include <mlir/IR/BuiltinAttributes.h>
13#include <mlir/IR/OpImplementation.h>
14
15#include <llvm/Support/Debug.h>
16
17using namespace mlir;
18
19namespace llzk::pod {
20
21//===----------------------------------------------------------------------===//
22// RecordAttr
23//===----------------------------------------------------------------------===//
24
25FlatSymbolRefAttr RecordAttr::getNameSym() const { return FlatSymbolRefAttr::get(getName()); }
26
27ParseResult parseRecord(AsmParser &parser, StringAttr &name, Type &type) {
28 auto result = parser.parseSymbolName(name);
29 if (mlir::failed(result)) {
30 return result;
31 }
32 return parser.parseColonType(type);
33}
34
35void printRecord(AsmPrinter &printer, StringAttr name, Type type) {
36 printer.printSymbolName(name.getValue());
37 printer << ": ";
38 printer.printType(type);
39}
40
41} // namespace llzk::pod
void printRecord(AsmPrinter &printer, StringAttr name, Type type)
Definition Attrs.cpp:35
ParseResult parseRecord(AsmParser &parser, StringAttr &name, Type &type)
Definition Attrs.cpp:27