14 #ifndef LLVM_CODEGEN_DWARFACCELTABLE_H 15 #define LLVM_CODEGEN_DWARFACCELTABLE_H 111 class DwarfCompileUnit;
132 virtual uint64_t
order()
const = 0;
150 : Name(Name), HashValue(Hash(Name.getString())) {}
203 template <
typename... Types>
207 template <
typename AccelTableDataT>
208 template <
typename... Types>
211 assert(Buckets.empty() &&
"Already finalized!");
215 assert(Iter->second.Name == Name);
216 Iter->second.Values.push_back(
217 new (
Allocator) AccelTableDataT(std::forward<Types>(
Args)...));
234 constexpr
Atom(uint16_t Type, uint16_t Form) : Type(Type), Form(Form) {}
279 : DieOffset(DieOffset), DieTag(DieTag), CUIndex(CUIndex) {}
294 uint64_t
order()
const override {
return DieOffset; }
304 template <
typename DataT>
307 static_assert(std::is_convertible<DataT *, AppleAccelTableData *>::value,
"");
314 ArrayRef<std::unique_ptr<DwarfCompileUnit>> CUs);
332 static constexpr
Atom Atoms[] = {
343 uint64_t
order()
const override {
return Die.getOffset(); }
357 static constexpr
Atom Atoms[] = {
381 static constexpr
Atom Atoms[] = {
402 bool ObjCClassIsImplementation,
405 QualifiedNameHash(QualifiedNameHash), Tag(Tag),
406 ObjCClassIsImplementation(ObjCClassIsImplementation) {}
412 static constexpr
Atom Atoms[] = {
415 Atom(5, dwarf::DW_FORM_data1),
Atom(6, dwarf::DW_FORM_data4)};
434 #endif // LLVM_CODEGEN_DWARFACCELTABLE_H StringRef getString() const
static uint32_t hash(StringRef Name)
std::vector< HashData * > HashList
void emitAppleAccelTable(AsmPrinter *Asm, AccelTable< DataT > &Contents, StringRef Prefix, const MCSymbol *SecBegin)
Emit an Apple Accelerator Table consisting of entries in the specified AccelTable.
DwarfStringPoolEntryRef Name
ArrayRef< HashList > getBuckets() const
This class represents lattice values for constants.
An Atom defines the form of the data in an Apple accelerator table.
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
uint64_t order() const override
static uint32_t hash(StringRef Name)
uint64_t getDieOffset() const
AccelTableBase(HashFn *Hash)
DWARF5AccelTableData(const DIE &Die)
Accelerator table data implementation for type accelerator tables with a DIE offset but no actual DIE...
Collects and handles dwarf debug information.
This class holds an abstract representation of an Accelerator Table, consisting of a sequence of buck...
unsigned getCUIndex() const
An efficient, type-erasing, non-owning reference to a callable.
uint64_t order() const override
void addName(DwarfStringPoolEntryRef Name, Types &&... Args)
Accelerator table data implementation for simple Apple accelerator tables with just a DIE reference...
This file defines the MallocAllocator and BumpPtrAllocator interfaces.
uint64_t order() const override
const uint16_t Type
Atom Type.
amdgpu Simplify well known AMD library false Value Value const Twine & Name
uint32_t getUniqueHashCount() const
unsigned getDieTag() const
void emitAppleAccelTableImpl(AsmPrinter *Asm, AccelTableBase &Contents, StringRef Prefix, const MCSymbol *SecBegin, ArrayRef< AppleAccelTableData::Atom > Atoms)
DWARF5AccelTableStaticData(uint64_t DieOffset, unsigned DieTag, unsigned CUIndex)
uint64_t getDieOffset() const
uint64_t order() const override
constexpr Atom(uint16_t Type, uint16_t Form)
Accelerator table data implementation for simple Apple accelerator tables with a DIE offset but no ac...
virtual ~AccelTableData()=default
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
virtual void print(raw_ostream &OS) const =0
static uint32_t hash(StringRef Buffer)
unsigned getDieTag() const
uint32_t getUniqueNameCount() const
static uint32_t computeBucketCount(uint32_t NumStrings)
Allocate memory in an ever growing pool, as if by bump-pointer.
A structured debug information entry.
std::vector< HashList > BucketList
This class is intended to be used as a driving class for all asm writers.
const DIE & getDie() const
AppleAccelTableStaticTypeData(uint32_t Offset, uint16_t Tag, bool ObjCClassIsImplementation, uint32_t QualifiedNameHash)
uint64_t order() const override
void emitDWARF5AccelTable(AsmPrinter *Asm, AccelTable< DWARF5AccelTableData > &Contents, const DwarfDebug &DD, ArrayRef< std::unique_ptr< DwarfCompileUnit >> CUs)
uint32_t djbHash(StringRef Buffer, uint32_t H=5381)
The Bernstein hash function used by the DWARF accelerator tables.
A base class for different implementations of Data classes for Apple Accelerator Tables.
std::vector< AccelTableData * > Values
AppleAccelTableTypeData(const DIE &D)
uint32_t QualifiedNameHash
Interface which the different types of accelerator table data have to conform.
virtual uint64_t order() const =0
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
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...
BumpPtrAllocator Allocator
Allocator for HashData and Values.
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
A base class holding non-template-dependant functionality of the AccelTable class.
StringMap - This is an unconventional map that is specialized for handling keys that are "strings"...
This file contains constants used for implementing Dwarf debug support.
const uint16_t Form
DWARF Form.
String pool entry reference.
AppleAccelTableOffsetData(const DIE &D)
Represents a group of entries with identical name (and hence, hash value).
The Data class implementation for DWARF v5 accelerator table.
Accelerator table data implementation for Apple type accelerator tables.
HashData(DwarfStringPoolEntryRef Name, HashFn *Hash)
bool operator<(const AccelTableData &Other) const
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
uint32_t(StringRef) HashFn
This class implements an extremely fast bulk output stream that can only output to a stream...
AppleAccelTableStaticOffsetData(uint32_t Offset)
unsigned getOffset() const
Get the compile/type unit relative offset of this DIE.
StringRef - Represent a constant reference to a string, i.e.
Marker as the end of a list of atoms.
bool ObjCClassIsImplementation
uint32_t getBucketCount() const
constexpr char Args[]
Key for Kernel::Metadata::mArgs.