1#ifndef PROTEUS_HASHING_HPP
2#define PROTEUS_HASHING_HPP
8#include <llvm/ADT/ArrayRef.h>
9#if LLVM_VERSION_MAJOR >= 18
10#include <llvm/ADT/StableHashing.h>
12#include <llvm/CodeGen/StableHashing.h>
29 inline std::string
toString()
const {
return std::to_string(Value); }
31 return Value ==
Other.Value;
35 return Value <
Other.Value;
43#if LLVM_VERSION_MAJOR >= 20
61 if (
RC.ArrInfo.NumElts <= 0)
63 std::to_string(
RC.ArrInfo.NumElts));
69 StringRef{
reinterpret_cast<const char *
>(
RC.ArrInfo.Blob.get()),
70 sizeof(
T) *
RC.ArrInfo.NumElts});
74 if (
RC.ObjInfo.Size <= 0)
81 StringRef{
reinterpret_cast<const char *
>(
RC.ObjInfo.Blob.get()),
82 static_cast<size_t>(
RC.ObjInfo.Size)});
89 switch (
RC.ArrInfo.EltType) {
110 StringRef{
reinterpret_cast<const char *
>(&
RC.Value),
sizeof(
RC.Value)});
121 for (
int I = 1,
E =
Arr.size();
I <
E; ++
I)
#define TIMESCOPE(x)
Definition TimeTracing.hpp:59
Definition Hashing.hpp:21
std::string toString() const
Definition Hashing.hpp:29
bool operator==(const HashT &Other) const
Definition Hashing.hpp:30
stable_hash getValue() const
Definition Hashing.hpp:28
bool operator<(const HashT &Other) const
Definition Hashing.hpp:34
HashT(const stable_hash HashValue)
Definition Hashing.hpp:26
HashT(const StringRef &S)
Definition Hashing.hpp:27
Definition ObjectCacheChain.cpp:26
HashT hashValue(const HashT &H)
Definition Hashing.hpp:39
@ ARRAY
Definition CompilerInterfaceTypes.h:33
@ VECTOR
Definition CompilerInterfaceTypes.h:32
@ INT32
Definition CompilerInterfaceTypes.h:25
@ INT64
Definition CompilerInterfaceTypes.h:26
@ FLOAT
Definition CompilerInterfaceTypes.h:27
@ STATIC_ARRAY
Definition CompilerInterfaceTypes.h:31
@ INT8
Definition CompilerInterfaceTypes.h:24
@ BOOL
Definition CompilerInterfaceTypes.h:23
@ OBJECT
Definition CompilerInterfaceTypes.h:34
@ DOUBLE
Definition CompilerInterfaceTypes.h:28
HashT hash(FirstT &&First, RestTs &&...Rest)
Definition Hashing.hpp:133
void reportFatalError(const llvm::Twine &Reason, const char *FILE, unsigned Line)
Definition Error.cpp:14
T getRuntimeConstantValue(void *Arg)
Definition CompilerInterfaceRuntimeConstantInfo.h:113
HashT hashArrayRefElement(const RuntimeConstant &RC)
Definition Hashing.hpp:85
HashT hashCombine(HashT A, HashT B)
Definition Hashing.hpp:128
std::string toString(CodegenOption Option)
Definition Config.hpp:26
HashT hashRuntimeConstantObject(const RuntimeConstant &RC)
Definition Hashing.hpp:73
bool isScalarRuntimeConstantType(RuntimeConstantType RCType)
Definition RuntimeConstantTypeHelpers.h:148
HashT hashRuntimeConstantArray(const RuntimeConstant &RC)
Definition Hashing.hpp:60
Definition Hashing.hpp:149
Definition CompilerInterfaceTypes.h:72
std::size_t operator()(const proteus::HashT &Key) const
Definition Hashing.hpp:151