Go to the documentation of this file.
9 #ifndef LLVM_DEBUGINFO_PDB_NATIVE_HASHTABLE_H
10 #define LLVM_DEBUGINFO_PDB_NATIVE_HASHTABLE_H
33 template <
typename ValueT>
36 std::forward_iterator_tag,
37 const std::pair<uint32_t, ValueT>> {
38 using BaseT =
typename HashTableIterator::iterator_facade_base;
47 int I = Map.Present.find_first();
68 return (Map == R.Map) && (
Index == R.Index);
70 const std::pair<uint32_t, ValueT> &
operator*()
const {
72 return Map->Buckets[
Index];
77 using BaseT::operator++;
81 if (Map->Present.test(
Index))
90 bool isEnd()
const {
return IsEnd; }
93 const HashTable<ValueT> *Map;
98 template <
typename ValueT>
105 using BucketList = std::vector<std::pair<uint32_t, ValueT>>;
118 if (
auto EC = Stream.readObject(
H))
120 if (
H->Capacity == 0)
122 "Invalid Hash Table Capacity");
123 if (
H->Size > maxLoad(
H->Capacity))
125 "Invalid Hash Table Size");
133 "Present bit vector does not match size!");
139 "Present bit vector intersects deleted!");
142 if (
auto EC = Stream.readInteger(
Buckets[
P].first))
145 if (
auto EC = Stream.readObject(
Value))
156 constexpr
int BitsPerWord = 8 *
sizeof(
uint32_t);
167 Size += NumWordsP *
sizeof(
uint32_t);
172 Size += NumWordsD *
sizeof(
uint32_t);
193 for (
const auto &Entry : *
this) {
217 template <
typename Key,
typename TraitsT>
224 if (Traits.storageKeyToLookupKey(
Buckets[
I].first) == K)
249 template <
typename Key,
typename TraitsT>
254 template <
typename Key,
typename TraitsT>
256 auto Iter =
find_as(K, Traits);
258 return (*Iter).second;
272 template <
typename Key,
typename TraitsT>
275 auto Entry =
find_as(K, Traits);
276 if (Entry !=
end()) {
278 assert(Traits.storageKeyToLookupKey(
Buckets[Entry.index()].first) == K);
280 Buckets[Entry.index()].second = V;
287 B.first = InternalKey ? *InternalKey : Traits.lookupKeyToStorageKey(K);
300 template <
typename TraitsT>
308 uint32_t NewCapacity = (
capacity() <= INT32_MAX) ? MaxLoad * 2 : UINT32_MAX;
315 auto LookupKey = Traits.storageKeyToLookupKey(
Buckets[
I].first);
316 NewMap.set_as_internal(LookupKey,
Buckets[
I].second, Traits,
332 #endif // LLVM_DEBUGINFO_PDB_NATIVE_HASHTABLE_H
uint64_t alignTo(uint64_t Size, Align A)
Returns a multiple of A needed to store Size bytes.
Error readSparseBitVector(BinaryStreamReader &Stream, SparseBitVector<> &V)
This is an optimization pass for GlobalISel generic memory operations.
Error writeInteger(T Value)
Write the integer Value to the underlying stream in the specified endianness.
Error writeSparseBitVector(BinaryStreamWriter &Writer, SparseBitVector<> &Vec)
const_iterator end() const
This currently compiles esp xmm0 movsd esp eax eax esp ret We should use not the dag combiner This is because dagcombine2 needs to be able to see through the X86ISD::Wrapper which DAGCombine can t really do The code for turning x load into a single vector load is target independent and should be moved to the dag combiner The code for turning x load into a vector load can only handle a direct load from a global or a direct load from the stack It should be generalized to handle any load from P
Error load(BinaryStreamReader &Stream)
Provides write only access to a subclass of WritableBinaryStream.
static ErrorSuccess success()
Create a success value.
Error commit(BinaryStreamWriter &Writer) const
bool operator==(const HashTableIterator &R) const
HashTable(uint32_t Capacity)
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
uint32_t calculateSerializedLength() const
const_iterator begin() const
ValueT get(const Key &K, TraitsT &Traits) const
Provides read only access to a subclass of BinaryStream.
bool set_as(const Key &K, ValueT V, TraitsT &Traits)
Set the entry using a key type that the specified Traits can convert from a real key to an internal k...
uint32_t capacity() const
detail::packed_endian_specific_integral< uint32_t, little, unaligned > ulittle32_t
HashTableIterator(const HashTable< ValueT > &Map)
compiles ldr LCPI1_0 ldr ldr mov lsr tst moveq r1 ldr LCPI1_1 and r0 bx lr It would be better to do something like to fold the shift into the conditional move
bool test(unsigned Idx) const
CRTP base class which implements the entire standard iterator facade in terms of a minimal subset of ...
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
void swap(llvm::BitVector &LHS, llvm::BitVector &RHS)
Implement std::swap in terms of BitVector swap.
bool intersects(const SparseBitVector< ElementSize > *RHS) const
Error writeObject(const T &Obj)
Writes the object Obj to the underlying stream, as if by using memcpy.
HashTableIterator< ValueT > const_iterator
const std::pair< uint32_t, ValueT > & operator*() const
add sub stmia L5 ldr r0 bl L_printf $stub Instead of a and a wouldn t it be better to do three moves *Return an aggregate type is even return S
Lightweight error class with error context and mandatory checking.
bool isDeleted(uint32_t K) const
HashTableIterator & operator++()
const_iterator find_as(const Key &K, TraitsT &Traits) const
Find the entry whose key has the specified hash value, using the specified traits defining hash funct...
bool isPresent(uint32_t K) const
HashTableIterator & operator=(const HashTableIterator &R)
LLVM Value Representation.