#include "llvm/DebugInfo/DWARF/DWARFAcceleratorTable.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/BinaryFormat/Dwarf.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/DJB.h"
#include "llvm/Support/Errc.h"
#include "llvm/Support/Format.h"
#include "llvm/Support/FormatVariadic.h"
#include "llvm/Support/ScopedPrinter.h"
#include "llvm/Support/raw_ostream.h"
#include <cstddef>
#include <cstdint>
#include <utility>
usingnamespacellvm;
namespace {
struct Atom { … };
static raw_ostream &operator<<(raw_ostream &OS, const Atom &A) { … }
}
static Atom formatAtom(unsigned Atom) { … }
DWARFAcceleratorTable::~DWARFAcceleratorTable() = default;
Error AppleAcceleratorTable::extract() { … }
uint32_t AppleAcceleratorTable::getNumBuckets() const { … }
uint32_t AppleAcceleratorTable::getNumHashes() const { … }
uint32_t AppleAcceleratorTable::getSizeHdr() const { … }
uint32_t AppleAcceleratorTable::getHeaderDataLength() const { … }
ArrayRef<std::pair<AppleAcceleratorTable::HeaderData::AtomType,
AppleAcceleratorTable::HeaderData::Form>>
AppleAcceleratorTable::getAtomsDesc() { … }
bool AppleAcceleratorTable::validateForms() { … }
std::pair<uint64_t, dwarf::Tag>
AppleAcceleratorTable::readAtoms(uint64_t *HashDataOffset) { … }
void AppleAcceleratorTable::Header::dump(ScopedPrinter &W) const { … }
std::optional<uint64_t> AppleAcceleratorTable::HeaderData::extractOffset(
std::optional<DWARFFormValue> Value) const { … }
bool AppleAcceleratorTable::dumpName(ScopedPrinter &W,
SmallVectorImpl<DWARFFormValue> &AtomForms,
uint64_t *DataOffset) const { … }
LLVM_DUMP_METHOD void AppleAcceleratorTable::dump(raw_ostream &OS) const { … }
AppleAcceleratorTable::Entry::Entry(const AppleAcceleratorTable &Table)
: … { … }
void AppleAcceleratorTable::Entry::extract(uint64_t *Offset) { … }
std::optional<DWARFFormValue>
AppleAcceleratorTable::Entry::lookup(HeaderData::AtomType AtomToFind) const { … }
std::optional<uint64_t>
AppleAcceleratorTable::Entry::getDIESectionOffset() const { … }
std::optional<uint64_t> AppleAcceleratorTable::Entry::getCUOffset() const { … }
std::optional<dwarf::Tag> AppleAcceleratorTable::Entry::getTag() const { … }
AppleAcceleratorTable::SameNameIterator::SameNameIterator(
const AppleAcceleratorTable &AccelTable, uint64_t DataOffset)
: … { … }
void AppleAcceleratorTable::Iterator::prepareNextEntryOrEnd() { … }
void AppleAcceleratorTable::Iterator::prepareNextStringOrEnd() { … }
AppleAcceleratorTable::Iterator::Iterator(const AppleAcceleratorTable &Table,
bool SetEnd)
: … { … }
iterator_range<AppleAcceleratorTable::SameNameIterator>
AppleAcceleratorTable::equal_range(StringRef Key) const { … }
std::optional<uint32_t>
AppleAcceleratorTable::idxOfHashInBucket(uint32_t HashToFind,
uint32_t BucketIdx) const { … }
std::optional<StringRef> AppleAcceleratorTable::readStringFromStrSection(
uint64_t StringSectionOffset) const { … }
std::optional<uint32_t>
AppleAcceleratorTable::readU32FromAccel(uint64_t &Offset,
bool UseRelocation) const { … }
void DWARFDebugNames::Header::dump(ScopedPrinter &W) const { … }
Error DWARFDebugNames::Header::extract(const DWARFDataExtractor &AS,
uint64_t *Offset) { … }
void DWARFDebugNames::Abbrev::dump(ScopedPrinter &W) const { … }
static constexpr DWARFDebugNames::AttributeEncoding sentinelAttrEnc() { … }
static bool isSentinel(const DWARFDebugNames::AttributeEncoding &AE) { … }
static DWARFDebugNames::Abbrev sentinelAbbrev() { … }
static bool isSentinel(const DWARFDebugNames::Abbrev &Abbr) { … }
DWARFDebugNames::Abbrev DWARFDebugNames::AbbrevMapInfo::getEmptyKey() { … }
DWARFDebugNames::Abbrev DWARFDebugNames::AbbrevMapInfo::getTombstoneKey() { … }
Expected<DWARFDebugNames::AttributeEncoding>
DWARFDebugNames::NameIndex::extractAttributeEncoding(uint64_t *Offset) { … }
Expected<std::vector<DWARFDebugNames::AttributeEncoding>>
DWARFDebugNames::NameIndex::extractAttributeEncodings(uint64_t *Offset) { … }
Expected<DWARFDebugNames::Abbrev>
DWARFDebugNames::NameIndex::extractAbbrev(uint64_t *Offset) { … }
DWARFDebugNames::DWARFDebugNamesOffsets
dwarf::findDebugNamesOffsets(uint64_t EndOfHeaderOffset,
const DWARFDebugNames::Header &Hdr) { … }
Error DWARFDebugNames::NameIndex::extract() { … }
DWARFDebugNames::Entry::Entry(const NameIndex &NameIdx, const Abbrev &Abbr)
: … { … }
std::optional<DWARFFormValue>
DWARFDebugNames::Entry::lookup(dwarf::Index Index) const { … }
bool DWARFDebugNames::Entry::hasParentInformation() const { … }
std::optional<uint64_t> DWARFDebugNames::Entry::getDIEUnitOffset() const { … }
std::optional<uint64_t> DWARFDebugNames::Entry::getRelatedCUIndex() const { … }
std::optional<uint64_t> DWARFDebugNames::Entry::getCUIndex() const { … }
std::optional<uint64_t> DWARFDebugNames::Entry::getCUOffset() const { … }
std::optional<uint64_t> DWARFDebugNames::Entry::getRelatedCUOffset() const { … }
std::optional<uint64_t> DWARFDebugNames::Entry::getLocalTUOffset() const { … }
std::optional<uint64_t>
DWARFDebugNames::Entry::getForeignTUTypeSignature() const { … }
std::optional<uint64_t> DWARFDebugNames::Entry::getLocalTUIndex() const { … }
Expected<std::optional<DWARFDebugNames::Entry>>
DWARFDebugNames::Entry::getParentDIEEntry() const { … }
void DWARFDebugNames::Entry::dumpParentIdx(
ScopedPrinter &W, const DWARFFormValue &FormValue) const { … }
void DWARFDebugNames::Entry::dump(ScopedPrinter &W) const { … }
char DWARFDebugNames::SentinelError::ID;
std::error_code DWARFDebugNames::SentinelError::convertToErrorCode() const { … }
uint64_t DWARFDebugNames::NameIndex::getCUOffset(uint32_t CU) const { … }
uint64_t DWARFDebugNames::NameIndex::getLocalTUOffset(uint32_t TU) const { … }
uint64_t DWARFDebugNames::NameIndex::getForeignTUSignature(uint32_t TU) const { … }
Expected<DWARFDebugNames::Entry>
DWARFDebugNames::NameIndex::getEntry(uint64_t *Offset) const { … }
DWARFDebugNames::NameTableEntry
DWARFDebugNames::NameIndex::getNameTableEntry(uint32_t Index) const { … }
uint32_t
DWARFDebugNames::NameIndex::getBucketArrayEntry(uint32_t Bucket) const { … }
uint32_t DWARFDebugNames::NameIndex::getHashArrayEntry(uint32_t Index) const { … }
bool DWARFDebugNames::NameIndex::dumpEntry(ScopedPrinter &W,
uint64_t *Offset) const { … }
void DWARFDebugNames::NameIndex::dumpName(ScopedPrinter &W,
const NameTableEntry &NTE,
std::optional<uint32_t> Hash) const { … }
void DWARFDebugNames::NameIndex::dumpCUs(ScopedPrinter &W) const { … }
void DWARFDebugNames::NameIndex::dumpLocalTUs(ScopedPrinter &W) const { … }
void DWARFDebugNames::NameIndex::dumpForeignTUs(ScopedPrinter &W) const { … }
void DWARFDebugNames::NameIndex::dumpAbbreviations(ScopedPrinter &W) const { … }
void DWARFDebugNames::NameIndex::dumpBucket(ScopedPrinter &W,
uint32_t Bucket) const { … }
LLVM_DUMP_METHOD void DWARFDebugNames::NameIndex::dump(ScopedPrinter &W) const { … }
Error DWARFDebugNames::extract() { … }
iterator_range<DWARFDebugNames::ValueIterator>
DWARFDebugNames::NameIndex::equal_range(StringRef Key) const { … }
LLVM_DUMP_METHOD void DWARFDebugNames::dump(raw_ostream &OS) const { … }
std::optional<uint64_t>
DWARFDebugNames::ValueIterator::findEntryOffsetInCurrentIndex() { … }
bool DWARFDebugNames::ValueIterator::getEntryAtCurrentOffset() { … }
bool DWARFDebugNames::ValueIterator::findInCurrentIndex() { … }
void DWARFDebugNames::ValueIterator::searchFromStartOfCurrentIndex() { … }
void DWARFDebugNames::ValueIterator::next() { … }
DWARFDebugNames::ValueIterator::ValueIterator(const DWARFDebugNames &AccelTable,
StringRef Key)
: … { … }
DWARFDebugNames::ValueIterator::ValueIterator(
const DWARFDebugNames::NameIndex &NI, StringRef Key)
: … { … }
iterator_range<DWARFDebugNames::ValueIterator>
DWARFDebugNames::equal_range(StringRef Key) const { … }
const DWARFDebugNames::NameIndex *
DWARFDebugNames::getCUNameIndex(uint64_t CUOffset) { … }
static bool isObjCSelector(StringRef Name) { … }
std::optional<ObjCSelectorNames> llvm::getObjCNamesIfSelector(StringRef Name) { … }
std::optional<StringRef> llvm::StripTemplateParameters(StringRef Name) { … }