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.
32LLVM_ABI uint32_t getKCFITypeID(StringRef MangledTypeName,
33 KCFIHashAlgorithm Algorithm);
34
35} // end namespace llvm
36
37#endif // LLVM_SUPPORT_HASH_H
#define LLVM_ABI
Definition Compiler.h:213
This is an optimization pass for GlobalISel generic memory operations.
LLVM_ABI KCFIHashAlgorithm parseKCFIHashAlgorithm(StringRef Name)
Parse a KCFI hash algorithm name.
Definition Hash.cpp:18
KCFIHashAlgorithm
Definition Hash.h:21
LLVM_ABI StringRef stringifyKCFIHashAlgorithm(KCFIHashAlgorithm Algorithm)
Convert a KCFI hash algorithm enum to its string representation.
Definition Hash.cpp:25
LLVM_ABI 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