24 : Pool(A), Prefix(Prefix),
25 ShouldCreateSymbols(Asm.MAI->doesDwarfUseRelocationsAcrossSections()) {}
29 auto I = Pool.insert(std::make_pair(Str,
EntryTy()));
31 auto &Entry =
I.first->second;
32 Entry.Index = Pool.size() - 1;
33 Entry.Offset = NumBytes;
36 NumBytes += Str.
size() + 1;
37 assert(NumBytes > Entry.Offset &&
"Unexpected overflow");
48 unsigned EntrySize = 4;
65 MCSection *OffsetSection,
bool UseRelativeOffsets) {
76 for (
const auto &
E : Pool)
77 Entries[
E.getValue().Index] = &
E;
79 for (
const auto &Entry : Entries) {
80 assert(ShouldCreateSymbols == static_cast<bool>(Entry->getValue().Symbol) &&
81 "Mismatch between setting and entry");
84 if (ShouldCreateSymbols)
85 Asm.
OutStreamer->EmitLabel(Entry->getValue().Symbol);
89 Twine(Entry->getValue().Offset));
91 StringRef(Entry->getKeyData(), Entry->getKeyLength() + 1));
98 for (
const auto &Entry : Entries)
99 if (UseRelativeOffsets)
Instances of this class represent a uniqued identifier for a section in the current translation unit...
std::unique_ptr< MCStreamer > OutStreamer
This is the MCStreamer object for the file we are generating.
Compute iterated dominance frontiers using a linear time algorithm.
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
uint16_t getDwarfVersion() const
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE size_t size() const
size - Get the string size.
void emit(AsmPrinter &Asm, MCSection *StrSection, MCSection *OffsetSection=nullptr, bool UseRelativeOffsets=false)
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
String pool entry reference.
Data for a string pool entry.
Allocate memory in an ever growing pool, as if by bump-pointer.
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
This class is intended to be used as a driving class for all asm writers.
void emitDwarfStringOffset(DwarfStringPoolEntry S) const
Emit the 4-byte offset of a string from the start of its section.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
void emitInt32(int Value) const
Emit a long directive and value.
DwarfStringPoolEntryRef EntryRef
void emitStringOffsetsTableHeader(AsmPrinter &Asm, MCSection *OffsetSection, MCSymbol *StartSym)
EntryRef getEntry(AsmPrinter &Asm, StringRef Str)
Get a reference to an entry in the string pool.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
StringRef - Represent a constant reference to a string, i.e.
MCSymbol * createTempSymbol(const Twine &Name) const
DwarfStringPool(BumpPtrAllocator &A, AsmPrinter &Asm, StringRef Prefix)
void emitInt16(int Value) const
Emit a short directive and value.