LLVM 20.0.0git
StructuralHash.h
Go to the documentation of this file.
1//===- llvm/IR/StructuralHash.h - IR Hashing --------------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// This file provides hashing of the LLVM IR structure to be used to check
10// Passes modification status.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_IR_STRUCTURALHASH_H
15#define LLVM_IR_STRUCTURALHASH_H
16
17#include <cstdint>
18
19namespace llvm {
20
21class Function;
22class Module;
23
25
26/// Returns a hash of the function \p F.
27/// \param F The function to hash.
28/// \param DetailedHash Whether or not to encode additional information in the
29/// hash. The additional information added into the hash when this flag is set
30/// to true includes instruction and operand type information.
31IRHash StructuralHash(const Function &F, bool DetailedHash = false);
32
33/// Returns a hash of the module \p M by hashing all functions and global
34/// variables contained within. \param M The module to hash. \param DetailedHash
35/// Whether or not to encode additional information in the function hashes that
36/// composed the module hash.
37IRHash StructuralHash(const Module &M, bool DetailedHash = false);
38
39} // end namespace llvm
40
41#endif
#define F(x, y, z)
Definition: MD5.cpp:55
Machine Check Debug Module
A Module instance is used to store all the information related to an LLVM module.
Definition: Module.h:65
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
IRHash StructuralHash(const Function &F, bool DetailedHash=false)
Returns a hash of the function F.