[PATCH] D87025: [DebugInfo] Make the offset of string pool entries 64-bit (18/19).
Igor Kudrin via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 14 22:26:03 PDT 2020
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG8c19ac23bdef: [DebugInfo] Make the offset of string pool entries 64-bit (18/19). (authored by ikudrin).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D87025/new/
https://reviews.llvm.org/D87025
Files:
llvm/include/llvm/CodeGen/DwarfStringPoolEntry.h
llvm/include/llvm/CodeGen/NonRelocatableStringpool.h
llvm/lib/CodeGen/AsmPrinter/DwarfStringPool.cpp
llvm/lib/CodeGen/AsmPrinter/DwarfStringPool.h
Index: llvm/lib/CodeGen/AsmPrinter/DwarfStringPool.h
===================================================================
--- llvm/lib/CodeGen/AsmPrinter/DwarfStringPool.h
+++ llvm/lib/CodeGen/AsmPrinter/DwarfStringPool.h
@@ -28,7 +28,7 @@
StringMap<EntryTy, BumpPtrAllocator &> Pool;
StringRef Prefix;
- unsigned NumBytes = 0;
+ uint64_t NumBytes = 0;
unsigned NumIndexedStrings = 0;
bool ShouldCreateSymbols;
Index: llvm/lib/CodeGen/AsmPrinter/DwarfStringPool.cpp
===================================================================
--- llvm/lib/CodeGen/AsmPrinter/DwarfStringPool.cpp
+++ llvm/lib/CodeGen/AsmPrinter/DwarfStringPool.cpp
@@ -33,7 +33,6 @@
Entry.Symbol = ShouldCreateSymbols ? Asm.createTempSymbol(Prefix) : nullptr;
NumBytes += Str.size() + 1;
- assert(NumBytes > Entry.Offset && "Unexpected overflow");
}
return *I.first;
}
Index: llvm/include/llvm/CodeGen/NonRelocatableStringpool.h
===================================================================
--- llvm/include/llvm/CodeGen/NonRelocatableStringpool.h
+++ llvm/include/llvm/CodeGen/NonRelocatableStringpool.h
@@ -39,7 +39,7 @@
/// 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 @@
private:
MapTy Strings;
- uint32_t CurrentEndOffset = 0;
+ uint64_t CurrentEndOffset = 0;
unsigned NumEntries = 0;
DwarfStringPoolEntryRef EmptyString;
std::function<StringRef(StringRef Input)> Translator;
Index: llvm/include/llvm/CodeGen/DwarfStringPoolEntry.h
===================================================================
--- llvm/include/llvm/CodeGen/DwarfStringPoolEntry.h
+++ llvm/include/llvm/CodeGen/DwarfStringPoolEntry.h
@@ -21,7 +21,7 @@
static constexpr unsigned NotIndexed = -1;
MCSymbol *Symbol;
- unsigned Offset;
+ uint64_t Offset;
unsigned Index;
bool isIndexed() const { return Index != NotIndexed; }
@@ -47,7 +47,7 @@
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());
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D87025.291797.patch
Type: text/x-patch
Size: 2673 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200915/be865a29/attachment-0001.bin>
More information about the llvm-commits
mailing list