LLZK 3.0.0
An open-source IR for Zero Knowledge (ZK) circuits
Loading...
Searching...
No Matches
StructSpecialization.h
Go to the documentation of this file.
1//===-- StructSpecialization.h ----------------------------------*- 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
10#pragma once
11
13
14#include <mlir/IR/BuiltinOps.h>
15#include <mlir/IR/SymbolTable.h>
16
17#include <llvm/ADT/DenseMap.h>
18#include <llvm/ADT/SmallVector.h>
19
20#include <optional>
21
22namespace llzk::polymorphic {
23
30 mlir::ModuleOp rootModule;
32 std::optional<llvm::DenseMap<int64_t, llvm::SmallVector<component::StructDefOp, 1>>> definitions;
33
34public:
35 explicit StructSpecializationResolver(mlir::ModuleOp module) : rootModule(module) {}
36
39 mlir::FailureOr<component::StructDefOp> resolve(
40 mlir::SymbolTableCollection &tables, component::StructType type, int64_t id,
41 mlir::Operation *site, mlir::StringRef diagnosticContext
42 );
43};
44
45} // namespace llzk::polymorphic
mlir::FailureOr< component::StructDefOp > resolve(mlir::SymbolTableCollection &tables, component::StructType type, int64_t id, mlir::Operation *site, mlir::StringRef diagnosticContext)
Resolve an ID and validate its source.