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
14namespace llzk {
15
16template <typename Op>
17concept OpHashable = requires(Op op) { op.getOperation(); };
18
19template <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
size_t operator()(const Op &op) const
Definition Hash.h:20