52 E.second.Values.erase(
llvm::unique(E.second.Values), E.second.Values.end());
65 Buckets[Bucket].push_back(&E.second);
66 E.second.Sym = Asm->createTempSymbol(Prefix);
73 return LHS->HashValue < RHS->HashValue;
80class AccelTableWriter {
88 const bool SkipIdenticalHashes;
90 void emitHashes()
const;
98 bool SkipIdenticalHashes)
99 : Asm(Asm), Contents(Contents), SkipIdenticalHashes(SkipIdenticalHashes) {
103class AppleAccelTableWriter :
public AccelTableWriter {
104 using Atom = AppleAccelTableData::Atom;
108 uint32_t
Magic = MagicHash;
111 uint32_t BucketCount;
113 uint32_t HeaderDataLength;
116 static const uint32_t MagicHash = 0x48415348;
118 Header(uint32_t BucketCount, uint32_t UniqueHashCount, uint32_t DataLength)
119 : BucketCount(BucketCount), HashCount(UniqueHashCount),
120 HeaderDataLength(DataLength) {}
122 void emit(AsmPrinter *Asm)
const;
124 void print(raw_ostream &OS)
const;
134 uint32_t DieOffsetBase;
139 : DieOffsetBase(
Offset), Atoms(AtomList) {}
141 void emit(AsmPrinter *Asm)
const;
143 void print(raw_ostream &OS)
const;
149 HeaderData HeaderData;
152 void emitBuckets()
const;
153 void emitData()
const;
156 AppleAccelTableWriter(AsmPrinter *Asm,
const AccelTableBase &Contents,
158 : AccelTableWriter(
Asm, Contents,
true),
159 Header(Contents.getBucketCount(), Contents.getUniqueHashCount(),
160 8 + (Atoms.
size() * 4)),
161 HeaderData(Atoms), SecBegin(SecBegin) {}
166 void print(raw_ostream &OS)
const;
175class Dwarf5AccelTableWriter :
public AccelTableWriter {
179 uint32_t CompUnitCount;
180 uint32_t LocalTypeUnitCount = 0;
181 uint32_t ForeignTypeUnitCount = 0;
182 uint32_t BucketCount = 0;
183 uint32_t NameCount = 0;
184 uint32_t AbbrevTableSize = 0;
185 uint32_t AugmentationStringSize =
sizeof(AugmentationString);
186 char AugmentationString[8] = {
'L',
'L',
'V',
'M',
'0',
'7',
'0',
'0'};
188 Header(uint32_t CompUnitCount, uint32_t LocalTypeUnitCount,
189 uint32_t ForeignTypeUnitCount, uint32_t BucketCount,
191 : CompUnitCount(CompUnitCount), LocalTypeUnitCount(LocalTypeUnitCount),
192 ForeignTypeUnitCount(ForeignTypeUnitCount), BucketCount(BucketCount),
193 NameCount(NameCount) {}
195 void emit(Dwarf5AccelTableWriter &Ctx);
200 FoldingSet<DebugNamesAbbrev> AbbreviationsSet;
208 llvm::function_ref<std::optional<DWARF5AccelTable::UnitIndexAndEncoding>(
209 const DWARF5AccelTableData &)>
211 MCSymbol *ContributionEnd =
nullptr;
212 MCSymbol *AbbrevStart =
Asm->createTempSymbol(
"names_abbrev_start");
213 MCSymbol *AbbrevEnd =
Asm->createTempSymbol(
"names_abbrev_end");
214 MCSymbol *EntryPool =
Asm->createTempSymbol(
"names_entries");
216 bool IsSplitDwarf =
false;
218 DenseSet<OffsetAndUnitID> IndexedOffsets;
220 void populateAbbrevsMap();
222 void emitCUList()
const;
223 void emitTUList()
const;
224 void emitBuckets()
const;
225 void emitStringOffsets()
const;
226 void emitAbbrevs()
const;
228 const DWARF5AccelTableData &Entry,
229 const DenseMap<OffsetAndUnitID, uint64_t> &DIEOffsetToAccelEntryOffset);
230 uint64_t getEntrySize(
const DWARF5AccelTableData &Entry)
const;
234 Dwarf5AccelTableWriter(
235 AsmPrinter *Asm,
const AccelTableBase &Contents,
236 ArrayRef<std::variant<MCSymbol *, uint64_t>> CompUnits,
237 ArrayRef<std::variant<MCSymbol *, uint64_t>> TypeUnits,
238 llvm::function_ref<std::optional<DWARF5AccelTable::UnitIndexAndEncoding>(
239 const DWARF5AccelTableData &)>
242 ~Dwarf5AccelTableWriter() {
243 for (DebugNamesAbbrev *Abbrev : AbbreviationsVector)
244 Abbrev->~DebugNamesAbbrev();
250void AccelTableWriter::emitHashes()
const {
251 uint64_t PrevHash = std::numeric_limits<uint64_t>::max();
252 unsigned BucketIdx = 0;
253 for (
const auto &Bucket : Contents.
getBuckets()) {
254 for (
const auto &Hash : Bucket) {
255 uint32_t HashValue = Hash->HashValue;
256 if (SkipIdenticalHashes && PrevHash == HashValue)
258 Asm->OutStreamer->AddComment(
"Hash in Bucket " +
Twine(BucketIdx));
259 Asm->emitInt32(HashValue);
260 PrevHash = HashValue;
266void AccelTableWriter::emitOffsets(
const MCSymbol *
Base)
const {
268 uint64_t PrevHash = std::numeric_limits<uint64_t>::max();
269 for (
size_t i = 0, e = Buckets.size(); i < e; ++i) {
270 for (
auto *Hash : Buckets[i]) {
271 uint32_t HashValue = Hash->HashValue;
272 if (SkipIdenticalHashes && PrevHash == HashValue)
274 PrevHash = HashValue;
275 Asm->OutStreamer->AddComment(
"Offset in Bucket " +
Twine(i));
276 Asm->emitLabelDifference(Hash->Sym,
Base,
Asm->getDwarfOffsetByteSize());
281void AppleAccelTableWriter::Header::emit(
AsmPrinter *Asm)
const {
282 Asm->OutStreamer->AddComment(
"Header Magic");
283 Asm->emitInt32(Magic);
284 Asm->OutStreamer->AddComment(
"Header Version");
286 Asm->OutStreamer->AddComment(
"Header Hash Function");
287 Asm->emitInt16(HashFunction);
288 Asm->OutStreamer->AddComment(
"Header Bucket Count");
289 Asm->emitInt32(BucketCount);
290 Asm->OutStreamer->AddComment(
"Header Hash Count");
291 Asm->emitInt32(HashCount);
292 Asm->OutStreamer->AddComment(
"Header Data Length");
293 Asm->emitInt32(HeaderDataLength);
296void AppleAccelTableWriter::HeaderData::emit(
AsmPrinter *Asm)
const {
297 Asm->OutStreamer->AddComment(
"HeaderData Die Offset Base");
298 Asm->emitInt32(DieOffsetBase);
299 Asm->OutStreamer->AddComment(
"HeaderData Atom Count");
302 for (
const Atom &
A : Atoms) {
304 Asm->emitInt16(
A.Type);
306 Asm->emitInt16(
A.Form);
310void AppleAccelTableWriter::emitBuckets()
const {
313 for (
size_t i = 0, e = Buckets.size(); i < e; ++i) {
314 Asm->OutStreamer->AddComment(
"Bucket " +
Twine(i));
315 if (!Buckets[i].
empty())
316 Asm->emitInt32(index);
318 Asm->emitInt32(std::numeric_limits<uint32_t>::max());
321 uint64_t PrevHash = std::numeric_limits<uint64_t>::max();
322 for (
auto *HD : Buckets[i]) {
323 uint32_t HashValue = HD->HashValue;
324 if (PrevHash != HashValue)
326 PrevHash = HashValue;
331void AppleAccelTableWriter::emitData()
const {
334 uint64_t PrevHash = std::numeric_limits<uint64_t>::max();
335 for (
const auto &Hash : Bucket) {
338 if (PrevHash != std::numeric_limits<uint64_t>::max() &&
339 PrevHash != Hash->HashValue)
342 Asm->OutStreamer->emitLabel(Hash->Sym);
343 Asm->OutStreamer->AddComment(Hash->Name.getString());
344 Asm->emitDwarfStringOffset(Hash->Name);
345 Asm->OutStreamer->AddComment(
"Num DIEs");
346 Asm->emitInt32(Hash->Values.size());
349 PrevHash = Hash->HashValue;
357void AppleAccelTableWriter::emit()
const {
359 HeaderData.emit(Asm);
362 emitOffsets(SecBegin);
372void Dwarf5AccelTableWriter::Header::emit(Dwarf5AccelTableWriter &Ctx) {
373 assert(CompUnitCount > 0 &&
"Index must have at least one CU.");
376 Ctx.ContributionEnd =
377 Asm->emitDwarfUnitLength(
"names",
"Header: unit length");
378 Asm->OutStreamer->AddComment(
"Header: version");
380 Asm->OutStreamer->AddComment(
"Header: padding");
381 Asm->emitInt16(Padding);
382 Asm->OutStreamer->AddComment(
"Header: compilation unit count");
383 Asm->emitInt32(CompUnitCount);
384 Asm->OutStreamer->AddComment(
"Header: local type unit count");
385 Asm->emitInt32(LocalTypeUnitCount);
386 Asm->OutStreamer->AddComment(
"Header: foreign type unit count");
387 Asm->emitInt32(ForeignTypeUnitCount);
388 Asm->OutStreamer->AddComment(
"Header: bucket count");
389 Asm->emitInt32(BucketCount);
390 Asm->OutStreamer->AddComment(
"Header: name count");
391 Asm->emitInt32(NameCount);
392 Asm->OutStreamer->AddComment(
"Header: abbreviation table size");
393 Asm->emitLabelDifference(Ctx.AbbrevEnd, Ctx.AbbrevStart,
sizeof(
uint32_t));
394 Asm->OutStreamer->AddComment(
"Header: augmentation string size");
395 assert(AugmentationStringSize % 4 == 0);
396 Asm->emitInt32(AugmentationStringSize);
397 Asm->OutStreamer->AddComment(
"Header: augmentation string");
398 Asm->OutStreamer->emitBytes({AugmentationString, AugmentationStringSize});
401std::optional<uint64_t>
404 Parent && !Parent->
findAttribute(dwarf::Attribute::DW_AT_declaration))
405 return Parent->getOffset();
409static std::optional<dwarf::Form>
411 std::optional<OffsetAndUnitID> ParentOffset) {
416 if (IndexedOffsets.
contains(*ParentOffset))
417 return dwarf::Form::DW_FORM_ref4;
419 return dwarf::Form::DW_FORM_flag_present;
425 ID.AddInteger(Enc.Index);
426 ID.AddInteger(Enc.Form);
430void Dwarf5AccelTableWriter::populateAbbrevsMap() {
432 for (
auto *Hash : Bucket) {
434 std::optional<DWARF5AccelTable::UnitIndexAndEncoding> EntryRet =
435 getIndexForEntry(*
Value);
437 IndexedOffsets,
Value->getParentDieOffsetAndUnitID());
440 Abbrev.addAttribute(EntryRet->Encoding);
441 Abbrev.addAttribute({dwarf::DW_IDX_die_offset, dwarf::DW_FORM_ref4});
443 Abbrev.addAttribute({dwarf::DW_IDX_parent, *MaybeParentForm});
449 Value->setAbbrevNumber(Existing->getNumber());
454 AbbreviationsVector.
push_back(NewAbbrev);
456 AbbreviationsSet.
InsertNode(NewAbbrev, InsertPos);
463void Dwarf5AccelTableWriter::emitCUList()
const {
464 for (
const auto &CU :
enumerate(CompUnits)) {
465 Asm->OutStreamer->AddComment(
"Compilation unit " +
Twine(CU.index()));
466 if (std::holds_alternative<MCSymbol *>(CU.value()))
467 Asm->emitDwarfSymbolReference(std::get<MCSymbol *>(CU.value()));
469 Asm->emitDwarfLengthOrOffset(std::get<uint64_t>(CU.value()));
473void Dwarf5AccelTableWriter::emitTUList()
const {
474 for (
const auto &TU :
enumerate(TypeUnits)) {
475 Asm->OutStreamer->AddComment(
"Type unit " +
Twine(TU.index()));
476 if (std::holds_alternative<MCSymbol *>(TU.value()))
477 Asm->emitDwarfSymbolReference(std::get<MCSymbol *>(TU.value()));
478 else if (IsSplitDwarf)
479 Asm->emitInt64(std::get<uint64_t>(TU.value()));
481 Asm->emitDwarfLengthOrOffset(std::get<uint64_t>(TU.value()));
485void Dwarf5AccelTableWriter::emitBuckets()
const {
488 Asm->OutStreamer->AddComment(
"Bucket " +
Twine(Bucket.index()));
489 Asm->emitInt32(Bucket.value().empty() ? 0 : Index);
490 Index += Bucket.value().size();
494void Dwarf5AccelTableWriter::emitStringOffsets()
const {
496 for (
auto *Hash : Bucket.value()) {
498 Asm->OutStreamer->AddComment(
"String in Bucket " +
Twine(Bucket.index()) +
499 ": " +
String.getString());
505void Dwarf5AccelTableWriter::emitAbbrevs()
const {
506 Asm->OutStreamer->emitLabel(AbbrevStart);
508 Asm->OutStreamer->AddComment(
"Abbrev code");
509 Asm->emitULEB128(Abbrev->getNumber());
511 Asm->emitULEB128(Abbrev->getDieTag());
513 Abbrev->getAttributes()) {
515 Asm->emitULEB128(AttrEnc.Form,
518 Asm->emitULEB128(0,
"End of abbrev");
519 Asm->emitULEB128(0,
"End of abbrev");
521 Asm->emitULEB128(0,
"End of abbrev list");
522 Asm->OutStreamer->emitLabel(AbbrevEnd);
525void Dwarf5AccelTableWriter::emitEntry(
528 unsigned AbbrevIndex =
Entry.getAbbrevNumber() - 1;
529 assert(AbbrevIndex < AbbreviationsVector.size() &&
530 "Entry abbrev index is outside of abbreviations vector range.");
532 std::optional<DWARF5AccelTable::UnitIndexAndEncoding> EntryRet =
533 getIndexForEntry(Entry);
534 std::optional<OffsetAndUnitID> MaybeParentOffset =
535 Entry.getParentDieOffsetAndUnitID();
537 Asm->emitULEB128(
Entry.getAbbrevNumber(),
"Abbreviation code");
542 switch (AttrEnc.Index) {
543 case dwarf::DW_IDX_compile_unit:
544 case dwarf::DW_IDX_type_unit: {
546 ID.emitValue(Asm, AttrEnc.Form);
549 case dwarf::DW_IDX_die_offset:
550 assert(AttrEnc.Form == dwarf::DW_FORM_ref4);
551 Asm->emitInt32(
Entry.getDieOffset());
553 case dwarf::DW_IDX_parent: {
554 if (AttrEnc.Form == dwarf::Form::DW_FORM_flag_present)
556 auto It = DIEOffsetToAccelEntryOffset.
find(*MaybeParentOffset);
557 assert(It != DIEOffsetToAccelEntryOffset.
end());
558 Asm->emitInt32(It->second);
569 unsigned AbbrevIndex =
Entry.getAbbrevNumber() - 1;
570 assert(AbbrevIndex < AbbreviationsVector.size());
573 std::optional<DWARF5AccelTable::UnitIndexAndEncoding> EntryRet =
574 getIndexForEntry(Entry);
576 switch (AttrEnc.Index) {
577 case dwarf::DW_IDX_compile_unit:
578 case dwarf::DW_IDX_type_unit:
580 .
sizeOf(
Asm->getDwarfFormParams(), AttrEnc.Form);
582 case dwarf::DW_IDX_die_offset:
585 case dwarf::DW_IDX_parent:
586 if (AttrEnc.Form != dwarf::Form::DW_FORM_flag_present)
596void Dwarf5AccelTableWriter::emitData() {
601 for (
auto *Hash : Bucket) {
611 Asm->OutStreamer->emitLabel(EntryPool);
613 for (
auto *Hash : Bucket) {
615 Asm->OutStreamer->emitLabel(Hash->Sym);
617 emitEntry(*
Value, DIEOffsetToAccelEntryOffset);
618 Asm->OutStreamer->AddComment(
"End of list: " + Hash->Name.getString());
624Dwarf5AccelTableWriter::Dwarf5AccelTableWriter(
626 ArrayRef<std::variant<MCSymbol *, uint64_t>> CompUnits,
627 ArrayRef<std::variant<MCSymbol *, uint64_t>> TypeUnits,
632 : AccelTableWriter(
Asm, Contents,
false),
633 Header(CompUnits.
size(), IsSplitDwarf ? 0 : TypeUnits.
size(),
634 IsSplitDwarf ? TypeUnits.
size() : 0, Contents.getBucketCount(),
635 Contents.getUniqueNameCount()),
636 CompUnits(CompUnits), TypeUnits(TypeUnits),
637 getIndexForEntry(std::
move(getIndexForEntry)),
638 IsSplitDwarf(IsSplitDwarf) {
641 for (
auto *Hash : Bucket)
642 for (
auto *
Value : Hash->getValues<DWARF5AccelTableData *>())
643 IndexedOffsets.
insert(
Value->getDieOffsetAndUnitID());
645 populateAbbrevsMap();
648void Dwarf5AccelTableWriter::emit() {
655 emitOffsets(EntryPool);
658 Asm->OutStreamer->emitValueToAlignment(
Align(4), 0);
659 Asm->OutStreamer->emitLabel(ContributionEnd);
666 AppleAccelTableWriter(Asm, Contents, Atoms, SecBegin).emit();
671 ArrayRef<std::unique_ptr<DwarfCompileUnit>> CUs) {
673 std::vector<std::variant<MCSymbol *, uint64_t>> CompUnits;
674 std::vector<std::variant<MCSymbol *, uint64_t>> TypeUnits;
680 switch (
CU.value()->getCUNode()->getNameTableKind()) {
687 CUIndex[
CU.index()] = CUCount++;
688 assert(
CU.index() ==
CU.value()->getUniqueID());
694 for (
const auto &TU : TUSymbols) {
695 TUIndex[TU.UniqueID] = TUCount++;
697 TypeUnits.push_back(std::get<uint64_t>(TU.LabelOrSignature));
699 TypeUnits.push_back(std::get<MCSymbol *>(TU.LabelOrSignature));
702 if (CompUnits.empty())
705 Asm->OutStreamer->switchSection(
706 Asm->getObjFileLowering().getDwarfDebugNamesSection());
713 Dwarf5AccelTableWriter(
714 Asm, Contents, CompUnits, TypeUnits,
716 -> std::optional<DWARF5AccelTable::UnitIndexAndEncoding> {
718 return {{TUIndex[Entry.getUnitID()],
719 {dwarf::DW_IDX_type_unit, TUIndexForm}}};
720 if (CUIndex.
size() > 1)
721 return {{CUIndex[Entry.getUnitID()],
722 {dwarf::DW_IDX_compile_unit, CUIndexForm}}};
730 TUSymbolsOrHashes.push_back({U.getLabelBegin(), U.getUniqueID()});
734 TUSymbolsOrHashes.push_back({U.getTypeSignature(), U.getUniqueID()});
739 ArrayRef<std::variant<MCSymbol *, uint64_t>> CUs,
743 std::vector<std::variant<MCSymbol *, uint64_t>> TypeUnits;
745 Dwarf5AccelTableWriter(Asm, Contents, CUs, TypeUnits, getIndexForEntry,
false)
750 assert(
Die.getDebugSectionOffset() <= UINT32_MAX &&
751 "The section offset exceeds the limit.");
752 Asm->emitInt32(
Die.getDebugSectionOffset());
756 assert(
Die.getDebugSectionOffset() <= UINT32_MAX &&
757 "The section offset exceeds the limit.");
758 Asm->emitInt32(
Die.getDebugSectionOffset());
759 Asm->emitInt16(
Die.getTag());
776void AppleAccelTableWriter::Header::print(
raw_ostream &OS)
const {
777 OS <<
"Magic: " <<
format(
"0x%x", Magic) <<
"\n"
778 <<
"Version: " <<
Version <<
"\n"
779 <<
"Hash Function: " << HashFunction <<
"\n"
780 <<
"Bucket Count: " << BucketCount <<
"\n"
781 <<
"Header Data Length: " << HeaderDataLength <<
"\n";
789void AppleAccelTableWriter::HeaderData::print(
raw_ostream &OS)
const {
790 OS <<
"DIE Offset Base: " << DieOffsetBase <<
"\n";
791 for (
auto Atom : Atoms)
795void AppleAccelTableWriter::print(
raw_ostream &OS)
const {
797 HeaderData.print(OS);
799 SecBegin->
print(OS,
nullptr);
803 OS <<
"Name: " <<
Name.getString() <<
"\n";
819 OS <<
"Name: " << Name <<
"\n";
820 for (
auto *V :
Data.Values)
824 OS <<
"Buckets and Hashes: \n";
825 for (
const auto &Bucket :
Buckets)
826 for (
const auto &
Hash : Bucket)
840 OS <<
" Offset: " <<
Die.getOffset() <<
"\n";
844 OS <<
" Offset: " <<
Die.getOffset() <<
"\n";
849 OS <<
" Static Offset: " <<
Offset <<
"\n";
853 OS <<
" Static Offset: " <<
Offset <<
"\n";
856 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
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.
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 the split dwarf proposal support.
DwarfStringPoolEntryRef: Dwarf string pool entry reference.
MCSymbol * getLabelBegin() const
Get the the symbol for start of the section for this unit.
void InsertNode(T *N, void *InsertPos)
InsertNode - Insert the specified node into the folding set, knowing that it is not already in the fo...
T * FindNodeOrInsertPos(const FoldingSetNodeID &ID, void *&InsertPos)
FindNodeOrInsertPos - Look up the node specified by ID.
FoldingSetNodeID - 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.
StringRef - 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.
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
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)
FunctionAddr VTableAddr Value
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)
LLVM_ABI void emitAppleAccelTableImpl(AsmPrinter *Asm, AccelTableBase &Contents, StringRef Prefix, const MCSymbol *SecBegin, ArrayRef< AppleAccelTableData::Atom > Atoms)
FunctionAddr VTableAddr uintptr_t uintptr_t Version
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.
FunctionAddr VTableAddr uintptr_t uintptr_t Data
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.
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.