9#ifndef LLVM_DWARFLINKER_PARALLEL_TYPEPOOL_H
10#define LLVM_DWARFLINKER_PARALLEL_TYPEPOOL_H
20namespace dwarf_linker {
59 std::atomic<DIE *>
Die = {
nullptr};
110 llvm::parallel::PerThreadBumpPtrAllocator,
115 llvm::parallel::PerThreadBumpPtrAllocator,
138 if (Entry->getValue().compare_exchange_weak(
DIE, NewDIE)) {
139 ParentEntry->
getValue().load()->Children.add(Entry);
148 std::function<void(
TypeEntry * Entry)> SortChildrenRec =
151 Entry->getValue().load()->Children.forEach(SortChildrenRec);
162 return Allocator.getThreadLocalAllocator();
168 return LHS->getKey() <
RHS->getKey();
This file defines the StringMap class.
This file defines the BumpPtrAllocator interface.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
Allocate memory in an ever growing pool, as if by bump-pointer.
A structured debug information entry.
const ValueTy & getValue() const
StringMapEntry - This is used to represent one value that is inserted into a StringMap.
static StringMapEntry * create(StringRef key, AllocatorTy &allocator, InitTy &&...initVals)
Create a StringMapEntry for the specified key construct the value using InitiVals.
StringRef - Represent a constant reference to a string, i.e.
This class is a simple list of T structures.
Keeps cloned data for the type DIE.
ArrayList< TypeEntry *, 5 > Children
Children for current type.
DIE & getFinalDie() const
Returns copy of type DIE which should be emitted into resulting file.
TypeEntryBody(TypeEntryBody &&RHS)=delete
bool hasOnlyDeclaration() const
Returns true if type die entry has only declaration die.
TypeEntryBody(const TypeEntryBody &RHS)=delete
TypeEntryBody(llvm::parallel::PerThreadBumpPtrAllocator &Allocator)
TypeEntryBody & operator=(const TypeEntryBody &RHS)=delete
std::atomic< bool > ParentIsDeclaration
std::atomic< DIE * > DeclarationDie
std::atomic< DIE * > Die
TypeEntryBody keeps partially cloned DIEs corresponding to this type.
static TypeEntryBody * create(llvm::parallel::PerThreadBumpPtrAllocator &Allocator)
Creates type DIE for the specified name.
TypeEntryBody & operator=(const TypeEntryBody &&RHS)=delete
static bool isEqual(const StringRef &LHS, const StringRef &RHS)
static TypeEntry * create(const StringRef &Key, llvm::parallel::PerThreadBumpPtrAllocator &Allocator)
static uint64_t getHashValue(const StringRef &Key)
static StringRef getKey(const TypeEntry &KeyData)
TypePool keeps type descriptors which contain partially cloned DIE correspinding to each type.
BumpPtrAllocator & getThreadLocalAllocator()
Return thread local allocator used by pool.
TypeEntryBody * getOrCreateTypeEntryBody(TypeEntry *Entry, TypeEntry *ParentEntry)
Create or return existing type entry body for the specified Entry.
TypeEntry * insert(StringRef Name)
TypeEntry * getRoot() const
Return root for all type entries.
std::function< bool(const TypeEntry *LHS, const TypeEntry *RHS)> TypesComparator
void sortTypes()
Sort children for each kept type entry.
StringMapEntry< std::atomic< TypeEntryBody * > > TypeEntry
PerThreadAllocator< BumpPtrAllocator > PerThreadBumpPtrAllocator
This is an optimization pass for GlobalISel generic memory operations.
uint64_t xxh3_64bits(ArrayRef< uint8_t > data)