13 #ifndef LLVM_CODEGEN_DWARFACCELTABLE_H 14 #define LLVM_CODEGEN_DWARFACCELTABLE_H 108 class DwarfCompileUnit;
129 virtual uint64_t
order()
const = 0;
147 : Name(Name), HashValue(Hash(Name.getString())) {}
200 template <
typename... Types>
204 template <
typename AccelTableDataT>
205 template <
typename... Types>
208 assert(Buckets.empty() &&
"Already finalized!");
212 assert(Iter->second.Name == Name);
213 Iter->second.Values.push_back(
214 new (
Allocator) AccelTableDataT(std::forward<Types>(
Args)...));
276 : DieOffset(DieOffset), DieTag(DieTag), CUIndex(CUIndex) {}
291 uint64_t
order()
const override {
return DieOffset; }
301 template <
typename DataT>
304 static_assert(std::is_convertible<DataT *, AppleAccelTableData *>::value,
"");
311 ArrayRef<std::unique_ptr<DwarfCompileUnit>> CUs);
327 static constexpr
Atom Atoms[] = {
334 uint64_t
order()
const override {
return Die.getOffset(); }
346 static constexpr
Atom Atoms[] = {
364 static constexpr
Atom Atoms[] = {
381 bool ObjCClassIsImplementation,
384 QualifiedNameHash(QualifiedNameHash), Tag(Tag),
385 ObjCClassIsImplementation(ObjCClassIsImplementation) {}
389 static constexpr
Atom Atoms[] = {
392 Atom(5, dwarf::DW_FORM_data1),
Atom(6, dwarf::DW_FORM_data4)};
407 #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
amdgpu Simplify well known AMD library false FunctionCallee Value const Twine & Name
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.
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
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.