LLZK
2.0.0
An open-source IR for Zero Knowledge (ZK) circuits
Loading...
Searching...
No Matches
Hash.h
Go to the documentation of this file.
1
//===-- Hash.h - Operation Hashing Utilities --------------------*- C++ -*-===//
2
//
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
7
//
8
//===----------------------------------------------------------------------===//
9
10
#pragma once
11
12
#include <mlir/IR/Operation.h>
13
14
#include <functional>
15
16
namespace
llzk
{
17
18
template
<
typename
Op>
19
concept
OpHashable
=
requires
(Op op) { op.getOperation(); };
20
21
template
<OpHashable Op>
struct
OpHash
{
22
size_t
operator()
(
const
Op &op)
const
{
23
return
std::hash<mlir::Operation *> {}(
const_cast<
Op &
>
(op).getOperation());
24
}
25
};
26
27
}
// namespace llzk
llzk::OpHashable
Definition
Hash.h:19
llzk
Definition
AnalysisPassEnums.cpp:19
llzk::OpHash
Definition
Hash.h:21
llzk::OpHash::operator()
size_t operator()(const Op &op) const
Definition
Hash.h:22
include
llzk
Util
Hash.h
Generated by
1.14.0
Copyright 2025 Veridise Inc. under the Apache License v2.0. Copyright 2026 Project LLZK under the Apache License v2.0.