LLVM
24.0.0git
include
llvm
DWARFLinker
StringPool.h
Go to the documentation of this file.
1
//===- StringPool.h ---------------------------------------------*- C++ -*-===//
2
//
3
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
// See https://llvm.org/LICENSE.txt for license information.
5
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
//
7
//===----------------------------------------------------------------------===//
8
9
#ifndef LLVM_DWARFLINKER_STRINGPOOL_H
10
#define LLVM_DWARFLINKER_STRINGPOOL_H
11
12
#include "
llvm/ADT/ConcurrentHashtable.h
"
13
#include "
llvm/CodeGen/DwarfStringPoolEntry.h
"
14
#include "
llvm/Support/Allocator.h
"
15
#include "
llvm/Support/PerThreadBumpPtrAllocator.h
"
16
#include <string_view>
17
18
namespace
llvm
{
19
namespace
dwarf_linker
{
20
21
/// StringEntry keeps data of the string: the length, external offset
22
/// and a string body which is placed right after StringEntry.
23
using
StringEntry
=
StringMapEntry<EmptyStringSetTag>
;
24
25
class
StringPool
26
:
public
ConcurrentHashTableByPtr
<
27
StringRef, StringEntry, llvm::parallel::PerThreadBumpPtrAllocator> {
28
public
:
29
StringPool
()
30
:
ConcurrentHashTableByPtr
<
StringRef
,
StringEntry
,
31
llvm
::
parallel
::PerThreadBumpPtrAllocator>(
32
Allocator) {}
33
34
StringPool
(
size_t
InitialSize)
35
:
ConcurrentHashTableByPtr
<
StringRef
,
StringEntry
,
36
llvm
::
parallel
::PerThreadBumpPtrAllocator>(
37
Allocator, InitialSize) {}
38
39
llvm::parallel::PerThreadBumpPtrAllocator
&
getAllocatorRef
() {
40
return
Allocator;
41
}
42
43
void
clear
() { Allocator.Reset(); }
44
45
private
:
46
llvm::parallel::PerThreadBumpPtrAllocator
Allocator
;
47
};
48
49
}
// namespace dwarf_linker
50
}
// end namespace llvm
51
52
#endif
// LLVM_DWARFLINKER_STRINGPOOL_H
Allocator.h
This file defines the BumpPtrAllocator interface.
ConcurrentHashtable.h
DwarfStringPoolEntry.h
PerThreadBumpPtrAllocator.h
Allocator
Basic Register Allocator
Definition
RegAllocBasic.cpp:61
llvm::ConcurrentHashTableByPtr< StringRef, StringEntry, llvm::parallel::PerThreadBumpPtrAllocator >::ConcurrentHashTableByPtr
ConcurrentHashTableByPtr(llvm::parallel::PerThreadBumpPtrAllocator &Allocator, uint64_t EstimatedSize=100000, size_t ThreadsNum=parallel::strategy.compute_thread_count(), size_t InitialNumberOfBuckets=128)
Definition
ConcurrentHashtable.h:103
llvm::StringMapEntry
StringMapEntry - This is used to represent one value that is inserted into a StringMap.
Definition
StringMapEntry.h:104
llvm::StringRef
Represent a constant reference to a string, i.e.
Definition
StringRef.h:56
llvm::dwarf_linker::StringPool::getAllocatorRef
llvm::parallel::PerThreadBumpPtrAllocator & getAllocatorRef()
Definition
StringPool.h:39
llvm::dwarf_linker::StringPool::StringPool
StringPool()
Definition
StringPool.h:29
llvm::dwarf_linker::StringPool::StringPool
StringPool(size_t InitialSize)
Definition
StringPool.h:34
llvm::dwarf_linker::StringPool::clear
void clear()
Definition
StringPool.h:43
llvm::dwarf_linker::parallel
Definition
DWARFUnit.h:47
llvm::dwarf_linker
Definition
DWARFDebugMacro.h:22
llvm::dwarf_linker::StringEntry
StringMapEntry< EmptyStringSetTag > StringEntry
StringEntry keeps data of the string: the length, external offset and a string body which is placed r...
Definition
StringPool.h:23
llvm::parallel::PerThreadBumpPtrAllocator
PerThreadAllocator< BumpPtrAllocator > PerThreadBumpPtrAllocator
Definition
PerThreadBumpPtrAllocator.h:136
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition
DefaultTargetInfo.h:21
Generated on
for LLVM by
1.14.0