LLVM 20.0.0git
|
This class is a simple list of T structures. More...
#include "DWARFLinker/Parallel/ArrayList.h"
Classes | |
struct | ItemsGroup |
Public Types | |
using | ItemHandlerTy = function_ref< void(T &)> |
Public Member Functions | |
ArrayList (llvm::parallel::PerThreadBumpPtrAllocator *Allocator) | |
T & | add (const T &Item) |
Add specified Item to the list. | |
void | forEach (ItemHandlerTy Handler) |
Enumerate all items and apply specified Handler to each. | |
bool | empty () |
Check whether list is empty. | |
void | erase () |
Erase list. | |
void | sort (function_ref< bool(const T &LHS, const T &RHS)> Comparator) |
size_t | size () |
Protected Member Functions | |
bool | allocateNewGroup (std::atomic< ItemsGroup * > &AtomicGroup) |
Protected Attributes | |
std::atomic< ItemsGroup * > | GroupsHead = nullptr |
std::atomic< ItemsGroup * > | LastGroup = nullptr |
llvm::parallel::PerThreadBumpPtrAllocator * | Allocator = nullptr |
This class is a simple list of T structures.
It keeps elements as pre-allocated groups to save memory for each element's next pointer. It allocates internal data using specified per-thread BumpPtrAllocator. Method add() can be called asynchronously.
Definition at line 23 of file ArrayList.h.
using llvm::dwarf_linker::parallel::ArrayList< T, ItemsGroupSize >::ItemHandlerTy = function_ref<void(T &)> |
Definition at line 60 of file ArrayList.h.
|
inline |
Definition at line 25 of file ArrayList.h.
|
inline |
Add specified Item
to the list.
Definition at line 29 of file ArrayList.h.
References llvm::dwarf_linker::parallel::ArrayList< T, ItemsGroupSize >::allocateNewGroup(), llvm::dwarf_linker::parallel::ArrayList< T, ItemsGroupSize >::Allocator, assert(), llvm::dwarf_linker::parallel::ArrayList< T, ItemsGroupSize >::GroupsHead, llvm::dwarf_linker::parallel::ArrayList< T, ItemsGroupSize >::ItemsGroup::Items, llvm::dwarf_linker::parallel::ArrayList< T, ItemsGroupSize >::ItemsGroup::ItemsCount, llvm::dwarf_linker::parallel::ArrayList< T, ItemsGroupSize >::LastGroup, and llvm::dwarf_linker::parallel::ArrayList< T, ItemsGroupSize >::ItemsGroup::Next.
Referenced by llvm::dwarf_linker::parallel::CompileUnit::saveAcceleratorInfo().
|
inlineprotected |
Definition at line 131 of file ArrayList.h.
References llvm::dwarf_linker::parallel::ArrayList< T, ItemsGroupSize >::Allocator, llvm::dwarf_linker::parallel::ArrayList< T, ItemsGroupSize >::ItemsGroup::ItemsCount, and llvm::dwarf_linker::parallel::ArrayList< T, ItemsGroupSize >::ItemsGroup::Next.
Referenced by llvm::dwarf_linker::parallel::ArrayList< T, ItemsGroupSize >::add().
|
inline |
Check whether list is empty.
Definition at line 72 of file ArrayList.h.
References llvm::dwarf_linker::parallel::ArrayList< T, ItemsGroupSize >::GroupsHead.
|
inline |
Erase list.
Definition at line 75 of file ArrayList.h.
References llvm::dwarf_linker::parallel::ArrayList< T, ItemsGroupSize >::GroupsHead, and llvm::dwarf_linker::parallel::ArrayList< T, ItemsGroupSize >::LastGroup.
Referenced by llvm::dwarf_linker::parallel::CompileUnit::maybeResetToLoadedStage().
|
inline |
Enumerate all items and apply specified Handler
to each.
Definition at line 63 of file ArrayList.h.
References llvm::dwarf_linker::parallel::ArrayList< T, ItemsGroupSize >::GroupsHead.
Referenced by llvm::dwarf_linker::parallel::CompileUnit::forEachAcceleratorRecord(), and llvm::dwarf_linker::parallel::ArrayList< T, ItemsGroupSize >::sort().
|
inline |
Definition at line 93 of file ArrayList.h.
References llvm::dwarf_linker::parallel::ArrayList< T, ItemsGroupSize >::GroupsHead.
|
inline |
Definition at line 80 of file ArrayList.h.
References assert(), llvm::SmallVectorTemplateCommon< T, typename >::begin(), llvm::SmallVectorTemplateCommon< T, typename >::end(), llvm::dwarf_linker::parallel::ArrayList< T, ItemsGroupSize >::forEach(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), and llvm::SmallVectorBase< Size_T >::size().
|
protected |
Definition at line 160 of file ArrayList.h.
Referenced by llvm::dwarf_linker::parallel::ArrayList< T, ItemsGroupSize >::add(), and llvm::dwarf_linker::parallel::ArrayList< T, ItemsGroupSize >::allocateNewGroup().
|
protected |
Definition at line 158 of file ArrayList.h.
Referenced by llvm::dwarf_linker::parallel::ArrayList< T, ItemsGroupSize >::add(), llvm::dwarf_linker::parallel::ArrayList< T, ItemsGroupSize >::empty(), llvm::dwarf_linker::parallel::ArrayList< T, ItemsGroupSize >::erase(), llvm::dwarf_linker::parallel::ArrayList< T, ItemsGroupSize >::forEach(), and llvm::dwarf_linker::parallel::ArrayList< T, ItemsGroupSize >::size().
|
protected |
Definition at line 159 of file ArrayList.h.
Referenced by llvm::dwarf_linker::parallel::ArrayList< T, ItemsGroupSize >::add(), and llvm::dwarf_linker::parallel::ArrayList< T, ItemsGroupSize >::erase().