13#ifndef LLVM_CODEGEN_ACCELTABLE_H
14#define LLVM_CODEGEN_ACCELTABLE_H
106class DwarfCompileUnit;
197 template <
typename... Types>
201template <
typename AccelTableDataT>
202template <
typename... Types>
205 assert(Buckets.empty() &&
"Already finalized!");
208 auto &It = Entries[
Name.getString()];
209 if (It.Values.empty()) {
211 It.HashValue = Hash(
Name.getString());
214 AccelTableDataT(std::forward<Types>(Args)...));
295 StringRef Prefix,
const MCSymbol *SecBegin,
296 ArrayRef<AppleAccelTableData::Atom> Atoms);
301template <
typename DataT>
304 static_assert(std::is_convertible<DataT *, AppleAccelTableData *>::value);
309 AccelTable<DWARF5AccelTableData> &Contents,
310 const DwarfDebug &DD,
311 ArrayRef<std::unique_ptr<DwarfCompileUnit>> CUs);
314 AsmPrinter *Asm, AccelTable<DWARF5AccelTableStaticData> &Contents,
315 ArrayRef<MCSymbol *> CUs,
392 Atom(5, dwarf::DW_FORM_data1),
Atom(6, dwarf::DW_FORM_data4)};
This file defines the StringMap class.
This file defines the BumpPtrAllocator interface.
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
This file contains constants used for implementing Dwarf debug support.
This file implements a map that provides insertion order iteration.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
A base class holding non-template-dependant functionality of the AccelTable class.
uint32_t getUniqueNameCount() const
std::vector< HashData * > HashList
std::vector< HashList > BucketList
BumpPtrAllocator Allocator
Allocator for HashData and Values.
void operator=(const AccelTableBase &)=delete
void computeBucketCount()
uint32_t getUniqueHashCount() const
void print(raw_ostream &OS) const
AccelTableBase(const AccelTableBase &)=delete
AccelTableBase(HashFn *Hash)
ArrayRef< HashList > getBuckets() const
uint32_t getBucketCount() const
uint32_t(StringRef) HashFn
Interface which the different types of accelerator table data have to conform.
virtual uint64_t order() const =0
virtual ~AccelTableData()=default
virtual void print(raw_ostream &OS) const =0
bool operator<(const AccelTableData &Other) const
This class holds an abstract representation of an Accelerator Table, consisting of a sequence of buck...
void addName(DwarfStringPoolEntryRef Name, Types &&... Args)
A base class for different implementations of Data classes for Apple Accelerator Tables.
virtual void emit(AsmPrinter *Asm) const =0
static uint32_t hash(StringRef Buffer)
Accelerator table data implementation for simple Apple accelerator tables with just a DIE reference.
uint64_t order() const override
void print(raw_ostream &OS) const override
static constexpr Atom Atoms[]
AppleAccelTableOffsetData(const DIE &D)
Accelerator table data implementation for simple Apple accelerator tables with a DIE offset but no ac...
AppleAccelTableStaticOffsetData(uint32_t Offset)
static constexpr Atom Atoms[]
void print(raw_ostream &OS) const override
uint64_t order() const override
Accelerator table data implementation for type accelerator tables with a DIE offset but no actual DIE...
uint32_t QualifiedNameHash
void print(raw_ostream &OS) const override
bool ObjCClassIsImplementation
static constexpr Atom Atoms[]
uint64_t order() const override
AppleAccelTableStaticTypeData(uint32_t Offset, uint16_t Tag, bool ObjCClassIsImplementation, uint32_t QualifiedNameHash)
Accelerator table data implementation for Apple type accelerator tables.
void print(raw_ostream &OS) const override
AppleAccelTableTypeData(const DIE &D)
static constexpr Atom Atoms[]
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
This class is intended to be used as a driving class for all asm writers.
Allocate memory in an ever growing pool, as if by bump-pointer.
A structured debug information entry.
unsigned getOffset() const
Get the compile/type unit relative offset of this DIE.
dwarf::Tag getTag() const
The Data class implementation for DWARF v5 accelerator table.
static uint32_t hash(StringRef Name)
void print(raw_ostream &OS) const override
DWARF5AccelTableData(const DIE &Die)
unsigned getDieTag() const
const DIE & getDie() const
uint64_t order() const override
uint64_t getDieOffset() const
static uint32_t hash(StringRef Name)
DWARF5AccelTableStaticData(uint64_t DieOffset, unsigned DieTag, unsigned CUIndex)
uint64_t getDieOffset() const
unsigned getDieTag() const
void print(raw_ostream &OS) const override
uint64_t order() const override
unsigned getCUIndex() const
DwarfStringPoolEntryRef: Dwarf string pool entry reference.
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
StringRef - Represent a constant reference to a string, i.e.
The instances of the Type class are immutable: once they are created, they are never changed.
An efficient, type-erasing, non-owning reference to a callable.
This class implements an extremely fast bulk output stream that can only output to a stream.
@ DW_ATOM_die_offset
Marker as the end of a list of atoms.
This is an optimization pass for GlobalISel generic memory operations.
void emitAppleAccelTableImpl(AsmPrinter *Asm, AccelTableBase &Contents, StringRef Prefix, const MCSymbol *SecBegin, ArrayRef< AppleAccelTableData::Atom > Atoms)
void emitDWARF5AccelTable(AsmPrinter *Asm, AccelTable< DWARF5AccelTableData > &Contents, const DwarfDebug &DD, ArrayRef< std::unique_ptr< DwarfCompileUnit > > CUs)
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
void emitAppleAccelTable(AsmPrinter *Asm, AccelTable< DataT > &Contents, StringRef Prefix, const MCSymbol *SecBegin)
Emit an Apple Accelerator Table consisting of entries in the specified AccelTable.
uint32_t caseFoldingDjbHash(StringRef Buffer, uint32_t H=5381)
Computes the Bernstein hash after folding the input according to the Dwarf 5 standard case folding ru...
uint32_t djbHash(StringRef Buffer, uint32_t H=5381)
The Bernstein hash function used by the DWARF accelerator tables.
Represents a group of entries with identical name (and hence, hash value).
void print(raw_ostream &OS) const
DwarfStringPoolEntryRef Name
std::vector< AccelTableData * > Values
An Atom defines the form of the data in an Apple accelerator table.
const uint16_t Form
DWARF Form.
void print(raw_ostream &OS) const
const uint16_t Type
Atom Type.
constexpr Atom(uint16_t Type, uint16_t Form)