LLVM 22.0.0git
Hash.h
Go to the documentation of this file.
1//===- llvm/Support/Hash.h - Hash functions --------------------*- 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 hash functions.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef LLVM_SUPPORT_HASH_H
14#define LLVM_SUPPORT_HASH_H
15
16#include "llvm/ADT/StringRef.h"
17#include <cstdint>
18
19namespace llvm {
20
22
23/// Parse a KCFI hash algorithm name.
24/// Returns xxHash64 if the name is not recognized.
26
27/// Convert a KCFI hash algorithm enum to its string representation.
29
30/// Compute KCFI type ID from mangled type name.
31/// The algorithm can be xxHash64 or FNV-1a.
32uint32_t getKCFITypeID(StringRef MangledTypeName, KCFIHashAlgorithm Algorithm);
33
34} // end namespace llvm
35
36#endif // LLVM_SUPPORT_HASH_H
This is an optimization pass for GlobalISel generic memory operations.
KCFIHashAlgorithm parseKCFIHashAlgorithm(StringRef Name)
Parse a KCFI hash algorithm name.
Definition Hash.cpp:18
KCFIHashAlgorithm
Definition Hash.h:21
StringRef stringifyKCFIHashAlgorithm(KCFIHashAlgorithm Algorithm)
Convert a KCFI hash algorithm enum to its string representation.
Definition Hash.cpp:25
uint32_t getKCFITypeID(StringRef MangledTypeName, KCFIHashAlgorithm Algorithm)
Compute KCFI type ID from mangled type name.
Definition Hash.cpp:35
LLVM_ABI uint64_t xxHash64(llvm::StringRef Data)
Definition xxhash.cpp:103