52 E.second.Values.erase(
llvm::unique(E.second.Values), E.second.Values.end());
71 if (LHS->HashValue != RHS->HashValue)
72 return LHS->HashValue < RHS->HashValue;
73 return LHS->Name.getString() < RHS->Name.getString();
80 Hash->Sym = Asm->createTempSymbol(Prefix);
86class AccelTableWriter {
94 const bool SkipIdenticalHashes;
96 void emitHashes()
const;
104 bool SkipIdenticalHashes)
105 : Asm(Asm), Contents(Contents), SkipIdenticalHashes(SkipIdenticalHashes) {
109class AppleAccelTableWriter :
public AccelTableWriter {
110 using Atom = AppleAccelTableData::Atom;
114 uint32_t
Magic = MagicHash;
117 uint32_t BucketCount;
119 uint32_t HeaderDataLength;
122 static const uint32_t MagicHash = 0x48415348;
124 Header(uint32_t BucketCount, uint32_t UniqueHashCount, uint32_t DataLength)
125 : BucketCount(BucketCount), HashCount(UniqueHashCount),
126 HeaderDataLength(DataLength) {}
128 void emit(AsmPrinter *Asm)
const;
130 void print(raw_ostream &OS)
const;
140 uint32_t DieOffsetBase;
145 : DieOffsetBase(
Offset), Atoms(AtomList) {}
147 void emit(AsmPrinter *Asm)
const;
149 void print(raw_ostream &OS)
const;
155 HeaderData HeaderData;
158 void emitBuckets()
const;
159 void emitData()
const;
162 AppleAccelTableWriter(AsmPrinter *Asm,
const AccelTableBase &Contents,
164 : AccelTableWriter(
Asm, Contents,
true),
165 Header(Contents.getBucketCount(), Contents.getUniqueHashCount(),
166 8 + (Atoms.
size() * 4)),
167 HeaderData(Atoms), SecBegin(SecBegin) {}
172 void print(raw_ostream &OS)
const;
181class Dwarf5AccelTableWriter :
public AccelTableWriter {
185 uint32_t CompUnitCount;
186 uint32_t LocalTypeUnitCount = 0;
187 uint32_t ForeignTypeUnitCount = 0;
188 uint32_t BucketCount = 0;
189 uint32_t NameCount = 0;
190 uint32_t AbbrevTableSize = 0;
191 uint32_t AugmentationStringSize =
sizeof(AugmentationString);
192 char AugmentationString[8] = {
'L',
'L',
'V',
'M',
'0',
'7',
'0',
'0'};
194 Header(uint32_t CompUnitCount, uint32_t LocalTypeUnitCount,
195 uint32_t ForeignTypeUnitCount, uint32_t BucketCount,
197 : CompUnitCount(CompUnitCount), LocalTypeUnitCount(LocalTypeUnitCount),
198 ForeignTypeUnitCount(ForeignTypeUnitCount), BucketCount(BucketCount),
199 NameCount(NameCount) {}
201 void emit(Dwarf5AccelTableWriter &Ctx);
214 llvm::function_ref<std::optional<DWARF5AccelTable::UnitIndexAndEncoding>(
215 const DWARF5AccelTableData &)>
217 MCSymbol *ContributionEnd =
nullptr;
218 MCSymbol *AbbrevStart =
Asm->createTempSymbol(
"names_abbrev_start");
219 MCSymbol *AbbrevEnd =
Asm->createTempSymbol(
"names_abbrev_end");
220 MCSymbol *EntryPool =
Asm->createTempSymbol(
"names_entries");
222 bool IsSplitDwarf =
false;
224 DenseSet<OffsetAndUnitID> IndexedOffsets;
226 void populateAbbrevsMap();
228 void emitCUList()
const;
229 void emitTUList()
const;
230 void emitBuckets()
const;
231 void emitStringOffsets()
const;
232 void emitAbbrevs()
const;
234 const DWARF5AccelTableData &Entry,
235 const DenseMap<OffsetAndUnitID, uint64_t> &DIEOffsetToAccelEntryOffset);
236 uint64_t getEntrySize(
const DWARF5AccelTableData &Entry)
const;
240 Dwarf5AccelTableWriter(
241 AsmPrinter *Asm,
const AccelTableBase &Contents,
242 ArrayRef<std::variant<MCSymbol *, uint64_t>> CompUnits,
243 ArrayRef<std::variant<MCSymbol *, uint64_t>> TypeUnits,
244 llvm::function_ref<std::optional<DWARF5AccelTable::UnitIndexAndEncoding>(
245 const DWARF5AccelTableData &)>
248 ~Dwarf5AccelTableWriter() {
249 for (DebugNamesAbbrev *Abbrev : AbbreviationsVector)
250 Abbrev->~DebugNamesAbbrev();
256void AccelTableWriter::emitHashes()
const {
257 uint64_t PrevHash = std::numeric_limits<uint64_t>::max();
258 unsigned BucketIdx = 0;
259 for (
const auto &Bucket : Contents.
getBuckets()) {
260 for (
const auto &Hash : Bucket) {
261 uint32_t HashValue = Hash->HashValue;
262 if (SkipIdenticalHashes && PrevHash == HashValue)
264 Asm->OutStreamer->AddComment(
"Hash in Bucket " +
Twine(BucketIdx));
265 Asm->emitInt32(HashValue);
266 PrevHash = HashValue;
272void AccelTableWriter::emitOffsets(
const MCSymbol *
Base)
const {
274 uint64_t PrevHash = std::numeric_limits<uint64_t>::max();
275 for (
size_t i = 0, e = Buckets.size(); i < e; ++i) {
276 for (
auto *Hash : Buckets[i]) {
277 uint32_t HashValue = Hash->HashValue;
278 if (SkipIdenticalHashes && PrevHash == HashValue)
280 PrevHash = HashValue;
281 Asm->OutStreamer->AddComment(
"Offset in Bucket " +
Twine(i));
282 Asm->emitLabelDifference(Hash->Sym,
Base,
Asm->getDwarfOffsetByteSize());
287void AppleAccelTableWriter::Header::emit(
AsmPrinter *Asm)
const {
288 Asm->OutStreamer->AddComment(
"Header Magic");
289 Asm->emitInt32(Magic);
290 Asm->OutStreamer->AddComment(
"Header Version");
292 Asm->OutStreamer->AddComment(
"Header Hash Function");
293 Asm->emitInt16(HashFunction);
294 Asm->OutStreamer->AddComment(
"Header Bucket Count");
295 Asm->emitInt32(BucketCount);
296 Asm->OutStreamer->AddComment(
"Header Hash Count");
297 Asm->emitInt32(HashCount);
298 Asm->OutStreamer->AddComment(
"Header Data Length");
299 Asm->emitInt32(HeaderDataLength);
302void AppleAccelTableWriter::HeaderData::emit(
AsmPrinter *Asm)
const {
303 Asm->OutStreamer->AddComment(
"HeaderData Die Offset Base");
304 Asm->emitInt32(DieOffsetBase);
305 Asm->OutStreamer->AddComment(
"HeaderData Atom Count");
308 for (
const Atom &
A : Atoms) {
310 Asm->emitInt16(
A.Type);
312 Asm->emitInt16(
A.Form);
316void AppleAccelTableWriter::emitBuckets()
const {
319 for (
size_t i = 0, e = Buckets.size(); i < e; ++i) {
320 Asm->OutStreamer->AddComment(
"Bucket " +
Twine(i));
321 if (!Buckets[i].
empty())
322 Asm->emitInt32(index);
324 Asm->emitInt32(std::numeric_limits<uint32_t>::max());
327 uint64_t PrevHash = std::numeric_limits<uint64_t>::max();
328 for (
auto *HD : Buckets[i]) {
329 uint32_t HashValue = HD->HashValue;
330 if (PrevHash != HashValue)
332 PrevHash = HashValue;
337void AppleAccelTableWriter::emitData()
const {
340 uint64_t PrevHash = std::numeric_limits<uint64_t>::max();
341 for (
const auto &Hash : Bucket) {
344 if (PrevHash != std::numeric_limits<uint64_t>::max() &&
345 PrevHash != Hash->HashValue)
348 Asm->OutStreamer->emitLabel(Hash->Sym);
349 Asm->OutStreamer->AddComment(Hash->Name.getString());
350 Asm->emitDwarfStringOffset(Hash->Name);
351 Asm->OutStreamer->AddComment(
"Num DIEs");
352 Asm->emitInt32(Hash->Values.size());
355 PrevHash = Hash->HashValue;
363void AppleAccelTableWriter::emit()
const {
365 HeaderData.emit(Asm);
368 emitOffsets(SecBegin);
378void Dwarf5AccelTableWriter::Header::emit(Dwarf5AccelTableWriter &Ctx) {
379 assert(CompUnitCount > 0 &&
"Index must have at least one CU.");
382 Ctx.ContributionEnd =
383 Asm->emitDwarfUnitLength(
"names",
"Header: unit length");
384 Asm->OutStreamer->AddComment(
"Header: version");
386 Asm->OutStreamer->AddComment(
"Header: padding");
387 Asm->emitInt16(Padding);
388 Asm->OutStreamer->AddComment(
"Header: compilation unit count");
389 Asm->emitInt32(CompUnitCount);
390 Asm->OutStreamer->AddComment(
"Header: local type unit count");
391 Asm->emitInt32(LocalTypeUnitCount);
392 Asm->OutStreamer->AddComment(
"Header: foreign type unit count");
393 Asm->emitInt32(ForeignTypeUnitCount);
394 Asm->OutStreamer->AddComment(
"Header: bucket count");
395 Asm->emitInt32(BucketCount);
396 Asm->OutStreamer->AddComment(
"Header: name count");
397 Asm->emitInt32(NameCount);
398 Asm->OutStreamer->AddComment(
"Header: abbreviation table size");
399 Asm->emitLabelDifference(Ctx.AbbrevEnd, Ctx.AbbrevStart,
sizeof(
uint32_t));
400 Asm->OutStreamer->AddComment(
"Header: augmentation string size");
401 assert(AugmentationStringSize % 4 == 0);
402 Asm->emitInt32(AugmentationStringSize);
403 Asm->OutStreamer->AddComment(
"Header: augmentation string");
404 Asm->OutStreamer->emitBytes({AugmentationString, AugmentationStringSize});
407std::optional<uint64_t>
410 Parent && !Parent->
findAttribute(dwarf::Attribute::DW_AT_declaration))
411 return Parent->getOffset();
415static std::optional<dwarf::Form>
417 std::optional<OffsetAndUnitID> ParentOffset) {
422 if (IndexedOffsets.
contains(*ParentOffset))
423 return dwarf::Form::DW_FORM_ref4;
425 return dwarf::Form::DW_FORM_flag_present;
431 ID.AddInteger(Enc.Index);
432 ID.AddInteger(Enc.Form);
436void Dwarf5AccelTableWriter::populateAbbrevsMap() {
438 for (
auto *Hash : Bucket) {
440 std::optional<DWARF5AccelTable::UnitIndexAndEncoding> EntryRet =
441 getIndexForEntry(*
Value);
443 IndexedOffsets,
Value->getParentDieOffsetAndUnitID());
446 Abbrev.addAttribute(EntryRet->Encoding);
447 Abbrev.addAttribute({dwarf::DW_IDX_die_offset, dwarf::DW_FORM_ref4});
449 Abbrev.addAttribute({dwarf::DW_IDX_parent, *MaybeParentForm});
454 Value->setAbbrevNumber(Existing->getNumber());
459 AbbreviationsVector.
push_back(NewAbbrev);
461 AbbreviationsSet.
insert(NewAbbrev, Token);
468void Dwarf5AccelTableWriter::emitCUList()
const {
469 for (
const auto &CU :
enumerate(CompUnits)) {
470 Asm->OutStreamer->AddComment(
"Compilation unit " +
Twine(CU.index()));
471 if (std::holds_alternative<MCSymbol *>(CU.value()))
472 Asm->emitDwarfSymbolReference(std::get<MCSymbol *>(CU.value()));
474 Asm->emitDwarfLengthOrOffset(std::get<uint64_t>(CU.value()));
478void Dwarf5AccelTableWriter::emitTUList()
const {
479 for (
const auto &TU :
enumerate(TypeUnits)) {
480 Asm->OutStreamer->AddComment(
"Type unit " +
Twine(TU.index()));
481 if (std::holds_alternative<MCSymbol *>(TU.value()))
482 Asm->emitDwarfSymbolReference(std::get<MCSymbol *>(TU.value()));
483 else if (IsSplitDwarf)
484 Asm->emitInt64(std::get<uint64_t>(TU.value()));
486 Asm->emitDwarfLengthOrOffset(std::get<uint64_t>(TU.value()));
490void Dwarf5AccelTableWriter::emitBuckets()
const {
493 Asm->OutStreamer->AddComment(
"Bucket " +
Twine(Bucket.index()));
494 Asm->emitInt32(Bucket.value().empty() ? 0 : Index);
495 Index += Bucket.value().size();
499void Dwarf5AccelTableWriter::emitStringOffsets()
const {
501 for (
auto *Hash : Bucket.value()) {
503 Asm->OutStreamer->AddComment(
"String in Bucket " +
Twine(Bucket.index()) +
504 ": " +
String.getString());
510void Dwarf5AccelTableWriter::emitAbbrevs()
const {
511 Asm->OutStreamer->emitLabel(AbbrevStart);
513 Asm->OutStreamer->AddComment(
"Abbrev code");
514 Asm->emitULEB128(Abbrev->getNumber());
516 Asm->emitULEB128(Abbrev->getDieTag());
518 Abbrev->getAttributes()) {
520 Asm->emitULEB128(AttrEnc.Form,
523 Asm->emitULEB128(0,
"End of abbrev");
524 Asm->emitULEB128(0,
"End of abbrev");
526 Asm->emitULEB128(0,
"End of abbrev list");
527 Asm->OutStreamer->emitLabel(AbbrevEnd);
530void Dwarf5AccelTableWriter::emitEntry(
533 unsigned AbbrevIndex =
Entry.getAbbrevNumber() - 1;
534 assert(AbbrevIndex < AbbreviationsVector.size() &&
535 "Entry abbrev index is outside of abbreviations vector range.");
537 std::optional<DWARF5AccelTable::UnitIndexAndEncoding> EntryRet =
538 getIndexForEntry(Entry);
539 std::optional<OffsetAndUnitID> MaybeParentOffset =
540 Entry.getParentDieOffsetAndUnitID();
542 Asm->emitULEB128(
Entry.getAbbrevNumber(),
"Abbreviation code");
547 switch (AttrEnc.Index) {
548 case dwarf::DW_IDX_compile_unit:
549 case dwarf::DW_IDX_type_unit: {
551 ID.emitValue(Asm, AttrEnc.Form);
554 case dwarf::DW_IDX_die_offset:
555 assert(AttrEnc.Form == dwarf::DW_FORM_ref4);
556 Asm->emitInt32(
Entry.getDieOffset());
558 case dwarf::DW_IDX_parent: {
559 if (AttrEnc.Form == dwarf::Form::DW_FORM_flag_present)
561 auto It = DIEOffsetToAccelEntryOffset.
find(*MaybeParentOffset);
562 assert(It != DIEOffsetToAccelEntryOffset.
end());
563 Asm->emitInt32(It->second);
574 unsigned AbbrevIndex =
Entry.getAbbrevNumber() - 1;
575 assert(AbbrevIndex < AbbreviationsVector.size());
578 std::optional<DWARF5AccelTable::UnitIndexAndEncoding> EntryRet =
579 getIndexForEntry(Entry);
581 switch (AttrEnc.Index) {
582 case dwarf::DW_IDX_compile_unit:
583 case dwarf::DW_IDX_type_unit:
585 .
sizeOf(
Asm->getDwarfFormParams(), AttrEnc.Form);
587 case dwarf::DW_IDX_die_offset:
590 case dwarf::DW_IDX_parent:
591 if (AttrEnc.Form != dwarf::Form::DW_FORM_flag_present)
601void Dwarf5AccelTableWriter::emitData() {
606 for (
auto *Hash : Bucket) {
616 Asm->OutStreamer->emitLabel(EntryPool);
618 for (
auto *Hash : Bucket) {
620 Asm->OutStreamer->emitLabel(Hash->Sym);
622 emitEntry(*
Value, DIEOffsetToAccelEntryOffset);
623 Asm->OutStreamer->AddComment(
"End of list: " + Hash->Name.getString());
629Dwarf5AccelTableWriter::Dwarf5AccelTableWriter(
631 ArrayRef<std::variant<MCSymbol *, uint64_t>> CompUnits,
632 ArrayRef<std::variant<MCSymbol *, uint64_t>> TypeUnits,
637 : AccelTableWriter(
Asm, Contents,
false),
638 Header(CompUnits.
size(), IsSplitDwarf ? 0 : TypeUnits.
size(),
639 IsSplitDwarf ? TypeUnits.
size() : 0, Contents.getBucketCount(),
640 Contents.getUniqueNameCount()),
641 CompUnits(CompUnits), TypeUnits(TypeUnits),
642 getIndexForEntry(std::
move(getIndexForEntry)),
643 IsSplitDwarf(IsSplitDwarf) {
646 for (
auto *Hash : Bucket)
647 for (
auto *
Value : Hash->getValues<DWARF5AccelTableData *>())
648 IndexedOffsets.
insert(
Value->getDieOffsetAndUnitID());
650 populateAbbrevsMap();
653void Dwarf5AccelTableWriter::emit() {
660 emitOffsets(EntryPool);
663 Asm->OutStreamer->emitValueToAlignment(
Align(4), 0);
664 Asm->OutStreamer->emitLabel(ContributionEnd);
671 AppleAccelTableWriter(Asm, Contents, Atoms, SecBegin).emit();
676 ArrayRef<std::unique_ptr<DwarfCompileUnit>> CUs) {
678 std::vector<std::variant<MCSymbol *, uint64_t>> CompUnits;
679 std::vector<std::variant<MCSymbol *, uint64_t>> TypeUnits;
685 switch (
CU.value()->getCUNode()->getNameTableKind()) {
692 CUIndex[
CU.index()] = CUCount++;
693 assert(
CU.index() ==
CU.value()->getUniqueID());
699 for (
const auto &TU : TUSymbols) {
700 TUIndex[TU.UniqueID] = TUCount++;
702 TypeUnits.push_back(std::get<uint64_t>(TU.LabelOrSignature));
704 TypeUnits.push_back(std::get<MCSymbol *>(TU.LabelOrSignature));
707 if (CompUnits.empty())
710 Asm->OutStreamer->switchSection(
711 Asm->getObjFileLowering().getDwarfDebugNamesSection());
718 Dwarf5AccelTableWriter(
719 Asm, Contents, CompUnits, TypeUnits,
721 -> std::optional<DWARF5AccelTable::UnitIndexAndEncoding> {
723 return {{TUIndex[Entry.getUnitID()],
724 {dwarf::DW_IDX_type_unit, TUIndexForm}}};
725 if (CUIndex.
size() > 1)
726 return {{CUIndex[Entry.getUnitID()],
727 {dwarf::DW_IDX_compile_unit, CUIndexForm}}};
735 TUSymbolsOrHashes.push_back({U.getLabelBegin(), U.getUniqueID()});
739 TUSymbolsOrHashes.push_back({U.getTypeSignature(), U.getUniqueID()});
744 ArrayRef<std::variant<MCSymbol *, uint64_t>> CUs,
748 std::vector<std::variant<MCSymbol *, uint64_t>> TypeUnits;
750 Dwarf5AccelTableWriter(Asm, Contents, CUs, TypeUnits, getIndexForEntry,
false)
755 assert(
Die.getDebugSectionOffset() <= UINT32_MAX &&
756 "The section offset exceeds the limit.");
757 Asm->emitInt32(
Die.getDebugSectionOffset());
761 assert(
Die.getDebugSectionOffset() <= UINT32_MAX &&
762 "The section offset exceeds the limit.");
763 Asm->emitInt32(
Die.getDebugSectionOffset());
764 Asm->emitInt16(
Die.getTag());
781void AppleAccelTableWriter::Header::print(
raw_ostream &OS)
const {
782 OS <<
"Magic: " <<
format(
"0x%x", Magic) <<
"\n"
783 <<
"Version: " <<
Version <<
"\n"
784 <<
"Hash Function: " << HashFunction <<
"\n"
785 <<
"Bucket Count: " << BucketCount <<
"\n"
786 <<
"Header Data Length: " << HeaderDataLength <<
"\n";
794void AppleAccelTableWriter::HeaderData::print(
raw_ostream &OS)
const {
795 OS <<
"DIE Offset Base: " << DieOffsetBase <<
"\n";
796 for (
auto Atom : Atoms)
800void AppleAccelTableWriter::print(
raw_ostream &OS)
const {
802 HeaderData.print(OS);
804 SecBegin->
print(OS,
nullptr);
808 OS <<
"Name: " <<
Name.getString() <<
"\n";
824 OS <<
"Name: " << Name <<
"\n";
825 for (
auto *V :
Data.Values)
829 OS <<
"Buckets and Hashes: \n";
830 for (
const auto &Bucket :
Buckets)
831 for (
const auto &
Hash : Bucket)
845 OS <<
" Offset: " <<
Die.getOffset() <<
"\n";
849 OS <<
" Offset: " <<
Die.getOffset() <<
"\n";
854 OS <<
" Static Offset: " <<
Offset <<
"\n";
858 OS <<
" Static Offset: " <<
Offset <<
"\n";
861 OS <<
" ObjCClassIsImplementation: "
for(const MachineOperand &MO :llvm::drop_begin(OldMI.operands(), Desc.getNumOperands()))
static std::optional< unsigned > getTag(const TargetRegisterInfo *TRI, const MachineInstr &MI, const LoadInfo &LI)
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static std::optional< dwarf::Form > getFormForIdxParent(const DenseSet< OffsetAndUnitID > &IndexedOffsets, std::optional< OffsetAndUnitID > ParentOffset)
This file contains support for writing accelerator tables.
Function Alias Analysis false
static void print(raw_ostream &Out, object::Archive::Kind Kind, T Val)
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
This file defines the DenseSet and SmallDenseSet classes.
This file contains constants used for implementing Dwarf debug support.
A base class holding non-template-dependant functionality of the AccelTable class.
std::vector< HashData * > HashList
LLVM_ABI void computeBucketCount()
LLVM_ABI void finalize(AsmPrinter *Asm, StringRef Prefix)
void print(raw_ostream &OS) const
ArrayRef< HashList > getBuckets() const
Interface which the different types of accelerator table data have to conform.
A base class for different implementations of Data classes for Apple Accelerator Tables.
void emit(AsmPrinter *Asm) const override
void print(raw_ostream &OS) const override
void emit(AsmPrinter *Asm) const override
void print(raw_ostream &OS) const override
uint32_t QualifiedNameHash
void emit(AsmPrinter *Asm) const override
void print(raw_ostream &OS) const override
bool ObjCClassIsImplementation
void print(raw_ostream &OS) const override
void emit(AsmPrinter *Asm) const override
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.
LLVM_ABI unsigned sizeOf(const dwarf::FormParams &FormParams, dwarf::Form Form) const
sizeOf - Determine size of integer value in bytes.
static dwarf::Form BestForm(bool IsSigned, uint64_t Int)
Choose the best form for integer.
A structured debug information entry.
LLVM_ABI DIEValue findAttribute(dwarf::Attribute Attribute) const
Find a value in the DIE with the attribute given.
LLVM_ABI DIE * getParent() const
The Data class implementation for DWARF v5 accelerator table.
void print(raw_ostream &OS) const override
unsigned getDieTag() const
std::variant< const DIE *, uint64_t > OffsetVal
LLVM_ABI DWARF5AccelTableData(const DIE &Die, const uint32_t UnitID, const bool IsTU)
static LLVM_ABI std::optional< uint64_t > getDefiningParentDieOffset(const DIE &Die)
If Die has a non-null parent and the parent is not a declaration, return its offset.
uint64_t getDieOffset() const
LLVM_ABI void addTypeUnitSignature(DwarfTypeUnit &U)
Add a type unit Signature.
const TUVectorTy & getTypeUnitsSymbols()
Returns type units that were constructed.
LLVM_ABI void addTypeUnitSymbol(DwarfTypeUnit &U)
Add a type unit start symbol.
void setNumber(uint32_t AbbrevNumber)
Set abbreviation tag index.
const SmallVector< AttributeEncoding, 1 > & getAttributes() const
Returns attributes for an abbreviation.
LLVM_ABI void Profile(FoldingSetNodeID &ID) const
Used to gather unique data for the abbreviation folding set.
uint32_t getNumber() const
Get abbreviation tag index.
iterator find(const_arg_type_t< KeyT > Val)
std::pair< iterator, bool > try_emplace(KeyT &&Key, Ts &&...Args)
Implements a dense probed hash-table based set.
Collects and handles dwarf debug information.
bool useSplitDwarf() const
Returns whether or not to change the current debug info for split DWARF.
DwarfStringPoolEntryRef: Dwarf string pool entry reference.
MCSymbol * getLabelBegin() const
Get the the symbol for start of the section for this unit.
void insert(T *N, FoldingSetInsertToken Token)
Insert the specified node into the folding set, knowing that it is not already in the folding set.
T * lookup(const FoldingSetNodeID &ID, FoldingSetInsertToken &Token)
Look up the node specified by ID.
Insertion token: a failed lookup fills it in, the matching insert consumes it.
This class is used to gather all the unique data bits of a node.
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
LLVM_ABI void print(raw_ostream &OS, const MCAsmInfo *MAI) const
print - Print the value to the stream OS.
void reserve(size_type N)
void push_back(const T &Elt)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Represent a constant reference to a string, i.e.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
LLVM Value Representation.
LLVM_ABI void print(raw_ostream &O, bool IsForDebug=false) const
Implement operator<< on Value.
std::pair< iterator, bool > insert(const ValueT &V)
bool contains(const_arg_type_t< ValueT > V) const
Check if the set contains the given element.
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.
LLVM_ABI StringRef FormEncodingString(unsigned Encoding)
LLVM_ABI StringRef IndexString(unsigned Idx)
LLVM_ABI StringRef AtomTypeString(unsigned Atom)
LLVM_ABI StringRef TagString(unsigned Tag)
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
uint32_t getDebugNamesBucketCount(uint32_t UniqueHashCount)
@ DW_FLAG_type_implementation
This is an optimization pass for GlobalISel generic memory operations.
void dump(const SparseBitVector< ElementSize > &LHS, raw_ostream &out)
void stable_sort(R &&Range)
auto size(R &&Range, std::enable_if_t< std::is_base_of< std::random_access_iterator_tag, typename std::iterator_traits< decltype(Range.begin())>::iterator_category >::value, void > *=nullptr)
Get the size of a range.
auto enumerate(FirstRange &&First, RestRanges &&...Rest)
Given two or more input ranges, returns a new range whose values are tuples (A, B,...
SmallVector< TypeUnitMetaInfo, 1 > TUVectorTy
auto unique(Range &&R, Predicate P)
RelativeUniformCounterPtr ValuesPtrExpr VTableAddr Value
LLVM_ABI void emitAppleAccelTableImpl(AsmPrinter *Asm, AccelTableBase &Contents, StringRef Prefix, const MCSymbol *SecBegin, ArrayRef< AppleAccelTableData::Atom > Atoms)
void sort(IteratorTy Start, IteratorTy End)
LLVM_ABI raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
class LLVM_GSL_OWNER SmallVector
Forward declaration of SmallVector so that calculateSmallVectorDefaultInlinedElements can reference s...
format_object< Ts... > format(const char *Fmt, const Ts &... Vals)
These are helper functions used to produce formatted output.
LLVM_ABI unsigned getULEB128Size(uint64_t Value)
Utility function to get the size of the ULEB128-encoded value.
ArrayRef(const T &OneElt) -> ArrayRef< T >
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
LLVM_ABI void emitDWARF5AccelTable(AsmPrinter *Asm, DWARF5AccelTable &Contents, const DwarfDebug &DD, ArrayRef< std::unique_ptr< DwarfCompileUnit > > CUs)
BumpPtrAllocatorImpl<> BumpPtrAllocator
The standard BumpPtrAllocator which just uses the default template parameters.
FoldingSetImpl< T, Trait > FoldingSet
This template class is used to instantiate a specialized implementation of the folding set to the nod...
Represents a group of entries with identical name (and hence, hash value).
void print(raw_ostream &OS) const
DwarfStringPoolEntryRef Name
std::vector< AccelTableData * > Values
This struct is a compact representation of a valid (non-zero power of two) alignment.
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.