9#ifndef LLVM_CAS_BUILTINOBJECTHASHER_H
10#define LLVM_CAS_BUILTINOBJECTHASHER_H
25 H.updateSize(Refs.
size());
27 H.updateRef(CAS,
Ref);
35 H.updateSize(Refs.size());
43 HashT finish() {
return Hasher.final(); }
45 void updateRef(
const ObjectStore &CAS, ObjectRef
Ref) {
46 updateID(CAS.getID(
Ref));
49 void updateID(
const CASID &
ID) { updateID(
ID.getHash()); }
51 void updateID(ArrayRef<uint8_t> Hash) {
55 "Expected object ref to match the hash size");
59 void updateArray(ArrayRef<uint8_t> Bytes) {
60 updateSize(Bytes.size());
64 void updateArray(ArrayRef<char> Bytes) {
75 BuiltinObjectHasher() =
default;
76 ~BuiltinObjectHasher() =
default;
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
size_t size() const
size - Get the array size.
Hasher for stored objects in builtin CAS.
static HashT hashObject(const ObjectStore &CAS, ArrayRef< ObjectRef > Refs, ArrayRef< char > Data)
static HashT hashObject(ArrayRef< ArrayRef< uint8_t > > Refs, ArrayRef< char > Data)
decltype(HasherT::hash(std::declval< ArrayRef< uint8_t > & >())) HashT
Reference to an object in an ObjectStore instance.
Content-addressable storage for objects.
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
BLAKE3 HasherT
Current hash type for the builtin CAS.
value_type byte_swap(value_type value, endianness endian)
@ Ref
The access may reference the value stored in memory.
ArrayRef(const T &OneElt) -> ArrayRef< T >