forked from OSchip/llvm-project
[DebugInfo] Make the offset of string pool entries 64-bit (18/19).
The string pool is shared among several units in the case of LTO, and it potentially can exceed the limit of 4GiB for an extremely large application. As it is now possible to emit 64-bit debugging info, the limitation can be removed. Differential Revision: https://reviews.llvm.org/D87025
This commit is contained in:
parent
7e1e4e81cb
commit
8c19ac23bd
|
@ -21,7 +21,7 @@ struct DwarfStringPoolEntry {
|
|||
static constexpr unsigned NotIndexed = -1;
|
||||
|
||||
MCSymbol *Symbol;
|
||||
unsigned Offset;
|
||||
uint64_t Offset;
|
||||
unsigned Index;
|
||||
|
||||
bool isIndexed() const { return Index != NotIndexed; }
|
||||
|
@ -47,7 +47,7 @@ public:
|
|||
assert(getMapEntry()->second.Symbol && "No symbol available!");
|
||||
return getMapEntry()->second.Symbol;
|
||||
}
|
||||
unsigned getOffset() const { return getMapEntry()->second.Offset; }
|
||||
uint64_t getOffset() const { return getMapEntry()->second.Offset; }
|
||||
bool isIndexed() const { return MapEntryAndIndexed.getInt(); }
|
||||
unsigned getIndex() const {
|
||||
assert(isIndexed());
|
||||
|
|
|
@ -39,7 +39,7 @@ public:
|
|||
|
||||
/// Get the offset of string \p S in the string table. This can insert a new
|
||||
/// element or return the offset of a pre-existing one.
|
||||
uint32_t getStringOffset(StringRef S) { return getEntry(S).getOffset(); }
|
||||
uint64_t getStringOffset(StringRef S) { return getEntry(S).getOffset(); }
|
||||
|
||||
/// Get permanent storage for \p S (but do not necessarily emit \p S in the
|
||||
/// output section). A latter call to getStringOffset() with the same string
|
||||
|
@ -57,7 +57,7 @@ public:
|
|||
|
||||
private:
|
||||
MapTy Strings;
|
||||
uint32_t CurrentEndOffset = 0;
|
||||
uint64_t CurrentEndOffset = 0;
|
||||
unsigned NumEntries = 0;
|
||||
DwarfStringPoolEntryRef EmptyString;
|
||||
std::function<StringRef(StringRef Input)> Translator;
|
||||
|
|
|
@ -33,7 +33,6 @@ DwarfStringPool::getEntryImpl(AsmPrinter &Asm, StringRef Str) {
|
|||
Entry.Symbol = ShouldCreateSymbols ? Asm.createTempSymbol(Prefix) : nullptr;
|
||||
|
||||
NumBytes += Str.size() + 1;
|
||||
assert(NumBytes > Entry.Offset && "Unexpected overflow");
|
||||
}
|
||||
return *I.first;
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ class DwarfStringPool {
|
|||
|
||||
StringMap<EntryTy, BumpPtrAllocator &> Pool;
|
||||
StringRef Prefix;
|
||||
unsigned NumBytes = 0;
|
||||
uint64_t NumBytes = 0;
|
||||
unsigned NumIndexedStrings = 0;
|
||||
bool ShouldCreateSymbols;
|
||||
|
||||
|
|
Loading…
Reference in New Issue