LLZK
0.1.0
Veridise's ZK Language IR
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 <functional>
13
14
namespace
llzk
{
15
16
template
<
typename
Op>
17
concept
OpHashable
=
requires
(Op op) { op.getOperation(); };
18
19
template
<OpHashable Op>
struct
OpHash
{
20
size_t
operator()
(
const
Op &op)
const
{
21
return
std::hash<mlir::Operation *> {}(
const_cast<
Op &
>
(op).getOperation());
22
}
23
};
24
25
}
// namespace llzk
llzk::OpHashable
Definition
Hash.h:17
llzk
Definition
CallGraph.cpp:29
llzk::OpHash
Definition
Hash.h:19
llzk::OpHash::operator()
size_t operator()(const Op &op) const
Definition
Hash.h:20
include
llzk
Util
Hash.h
Generated by
1.13.2
Copyright 2025 Veridise Inc. under the Apache License v2.0.