LLVM 19.0.0git
Public Member Functions | Protected Attributes | List of all members
llvm::dwarf_linker::parallel::TypePool Class Reference

TypePool keeps type descriptors which contain partially cloned DIE correspinding to each type. More...

#include "DWARFLinker/Parallel/TypePool.h"

Inheritance diagram for llvm::dwarf_linker::parallel::TypePool:
Inheritance graph
[legend]

Public Member Functions

 TypePool ()
 
TypeEntryinsert (StringRef Name)
 
TypeEntryBodygetOrCreateTypeEntryBody (TypeEntry *Entry, TypeEntry *ParentEntry)
 Create or return existing type entry body for the specified Entry.
 
void sortTypes ()
 Sort children for each kept type entry.
 
TypeEntrygetRoot () const
 Return root for all type entries.
 
BumpPtrAllocatorgetThreadLocalAllocator ()
 Return thread local allocator used by pool.
 

Protected Attributes

std::function< bool(const TypeEntry *LHS, const TypeEntry *RHS)> TypesComparator
 
TypeEntryRoot = nullptr
 

Detailed Description

TypePool keeps type descriptors which contain partially cloned DIE correspinding to each type.

Types are identified by names.

Definition at line 108 of file TypePool.h.

Constructor & Destructor Documentation

◆ TypePool()

llvm::dwarf_linker::parallel::TypePool::TypePool ( )
inline

Member Function Documentation

◆ getOrCreateTypeEntryBody()

TypeEntryBody * llvm::dwarf_linker::parallel::TypePool::getOrCreateTypeEntryBody ( TypeEntry Entry,
TypeEntry ParentEntry 
)
inline

Create or return existing type entry body for the specified Entry.

Link that entry as child for the specified ParentEntry.

Returns
The existing or created type entry body.

Definition at line 131 of file TypePool.h.

References llvm::dwarf_linker::parallel::TypeEntryBody::create(), and llvm::StringMapEntryStorage< ValueTy >::getValue().

◆ getRoot()

TypeEntry * llvm::dwarf_linker::parallel::TypePool::getRoot ( ) const
inline

Return root for all type entries.

Definition at line 158 of file TypePool.h.

References Root.

Referenced by llvm::dwarf_linker::parallel::CompileUnit::cloneAndEmit(), llvm::dwarf_linker::parallel::TypeUnit::createDIETree(), and sortTypes().

◆ getThreadLocalAllocator()

BumpPtrAllocator & llvm::dwarf_linker::parallel::TypePool::getThreadLocalAllocator ( )
inline

Return thread local allocator used by pool.

Definition at line 161 of file TypePool.h.

Referenced by llvm::dwarf_linker::parallel::CompileUnit::cloneDIE().

◆ insert()

TypeEntry * llvm::dwarf_linker::parallel::TypePool::insert ( StringRef  Name)
inline

◆ sortTypes()

void llvm::dwarf_linker::parallel::TypePool::sortTypes ( )
inline

Sort children for each kept type entry.

Definition at line 147 of file TypePool.h.

References getRoot(), and TypesComparator.

Member Data Documentation

◆ Root

TypeEntry* llvm::dwarf_linker::parallel::TypePool::Root = nullptr
protected

Definition at line 172 of file TypePool.h.

Referenced by getRoot(), and TypePool().

◆ TypesComparator

std::function<bool(const TypeEntry *LHS, const TypeEntry *RHS)> llvm::dwarf_linker::parallel::TypePool::TypesComparator
protected
Initial value:
= [](const TypeEntry *LHS, const TypeEntry *RHS) -> bool {
return LHS->getKey() < RHS->getKey();
}
Value * RHS
Value * LHS
StringMapEntry< std::atomic< TypeEntryBody * > > TypeEntry
Definition: TypePool.h:27

Definition at line 167 of file TypePool.h.

Referenced by sortTypes().


The documentation for this class was generated from the following file: