LLVM 23.0.0git
KCFIHash.h
Go to the documentation of this file.
1//===----------------------------------------------------------------------===//
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// Helpers for computing the 32-bit KCFI type ID from a mangled type name.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef LLVM_TRANSFORMS_UTILS_KCFIHASH_H
14#define LLVM_TRANSFORMS_UTILS_KCFIHASH_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_TRANSFORMS_UTILS_KCFIHASH_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 KCFIHash.cpp:107
KCFIHashAlgorithm
Definition KCFIHash.h:21
LLVM_ABI StringRef stringifyKCFIHashAlgorithm(KCFIHashAlgorithm Algorithm)
Convert a KCFI hash algorithm enum to its string representation.
Definition KCFIHash.cpp:114
LLVM_ABI uint32_t getKCFITypeID(StringRef MangledTypeName, KCFIHashAlgorithm Algorithm)
Compute KCFI type ID from mangled type name.
Definition KCFIHash.cpp:124