LLVM 20.0.0git
|
A string table that doesn't need relocations. More...
#include "llvm/CodeGen/NonRelocatableStringpool.h"
Public Types | |
using | MapTy = StringMap< DwarfStringPoolEntry, BumpPtrAllocator > |
Entries are stored into the StringMap and simply linked together through the second element of this pair in order to keep track of insertion order. | |
Public Member Functions | |
NonRelocatableStringpool (bool PutEmptyString=false) | |
DwarfStringPoolEntryRef | getEntry (StringRef S) |
uint64_t | getStringOffset (StringRef S) |
Get the offset of string S in the string table. | |
StringRef | internString (StringRef S) |
Get permanent storage for S (but do not necessarily emit S in the output section). | |
uint64_t | getSize () |
std::vector< DwarfStringPoolEntryRef > | getEntriesForEmission () const |
Return the list of strings to be emitted. | |
A string table that doesn't need relocations.
Use this class when a string table doesn't need relocations. This class provides this ability by just associating offsets with strings.
Definition at line 23 of file NonRelocatableStringpool.h.
Entries are stored into the StringMap and simply linked together through the second element of this pair in order to keep track of insertion order.
Definition at line 28 of file NonRelocatableStringpool.h.
|
inline |
Definition at line 30 of file NonRelocatableStringpool.h.
References getEntry().
std::vector< DwarfStringPoolEntryRef > llvm::NonRelocatableStringpool::getEntriesForEmission | ( | ) | const |
Return the list of strings to be emitted.
This does not contain the strings which were added via internString only.
Definition at line 34 of file NonRelocatableStringpool.cpp.
References A, B, E, llvm::StringMapImpl::size(), and llvm::sort().
Referenced by llvm::dwarf_linker::classic::DwarfStreamer::emitLineStrings(), and llvm::dwarf_linker::classic::DwarfStreamer::emitStrings().
DwarfStringPoolEntryRef llvm::NonRelocatableStringpool::getEntry | ( | StringRef | S | ) |
Definition at line 14 of file NonRelocatableStringpool.cpp.
References I, llvm::StringMap< ValueTy, AllocatorTy >::insert(), and llvm::StringRef::size().
Referenced by getStringOffset(), and NonRelocatableStringpool().
|
inline |
Definition at line 49 of file NonRelocatableStringpool.h.
Get the offset of string S
in the string table.
This can insert a new element or return the offset of a pre-existing one.
Definition at line 39 of file NonRelocatableStringpool.h.
References getEntry(), and llvm::DwarfStringPoolEntryRef::getOffset().
Get permanent storage for S
(but do not necessarily emit S
in the output section).
A latter call to getStringOffset() with the same string will chain it though.
S
. Definition at line 26 of file NonRelocatableStringpool.cpp.
References llvm::StringMap< ValueTy, AllocatorTy >::insert(), and llvm::DwarfStringPoolEntry::NotIndexed.