19 : Pool(A), Prefix(Prefix),
20 ShouldCreateSymbols(Asm.MAI->doesDwarfUseRelocationsAcrossSections()) {}
24 auto I = Pool.insert(std::make_pair(Str,
EntryTy()));
26 auto &Entry =
I.first->second;
27 Entry.Index = Pool.size() - 1;
28 Entry.Offset = NumBytes;
31 NumBytes += Str.
size() + 1;
32 assert(NumBytes > Entry.Offset &&
"Unexpected overflow");
49 for (
const auto &
E : Pool)
50 Entries[
E.getValue().Index] = &
E;
52 for (
const auto &Entry : Entries) {
53 assert(ShouldCreateSymbols == static_cast<bool>(Entry->getValue().Symbol) &&
54 "Mismatch between setting and entry");
57 if (ShouldCreateSymbols)
58 Asm.
OutStreamer->EmitLabel(Entry->getValue().Symbol);
62 Twine(Entry->getValue().Offset));
64 StringRef(Entry->getKeyData(), Entry->getKeyLength() + 1));
71 for (
const auto &Entry : Entries)
72 Asm.
OutStreamer->EmitIntValue(Entry->getValue().Offset, size);
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.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
String pool entry reference.
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE size_t size() const
size - Get the string size.
Data for a string pool entry.
static GCRegistry::Add< CoreCLRGC > E("coreclr","CoreCLR-compatible GC")
Allocate memory in an ever growing pool, as if by bump-pointer.
This class is intended to be used as a driving class for all asm writers.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
MCSymbol * createTempSymbol(const Twine &Name) const
DwarfStringPoolEntryRef EntryRef
EntryRef getEntry(AsmPrinter &Asm, StringRef Str)
Get a reference to an entry in the string pool.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
void emit(AsmPrinter &Asm, MCSection *StrSection, MCSection *OffsetSection=nullptr)
StringRef - Represent a constant reference to a string, i.e.
static GCRegistry::Add< ErlangGC > A("erlang","erlang-compatible garbage collector")
DwarfStringPool(BumpPtrAllocator &A, AsmPrinter &Asm, StringRef Prefix)