aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/AsmPrinter/DwarfStringPool.cpp
diff options
context:
space:
mode:
authorIgor Kudrin <ikudrin@accesssoftek.com>2020-09-15 11:30:53 +0700
committerIgor Kudrin <ikudrin@accesssoftek.com>2020-09-15 11:30:53 +0700
commit383d34c077ae7f845bf751936f59f12598e60b3e (patch)
treefd0f804998cffc3d5011294aa6e19cb93cc3dbea /llvm/lib/CodeGen/AsmPrinter/DwarfStringPool.cpp
parent26f1f18831342e9c5e137e68d067d7383d72f30d (diff)
downloadllvm-383d34c077ae7f845bf751936f59f12598e60b3e.zip
llvm-383d34c077ae7f845bf751936f59f12598e60b3e.tar.gz
llvm-383d34c077ae7f845bf751936f59f12598e60b3e.tar.bz2
[DebugInfo] Fix emitting DWARF64 .debug_str_offsets sections (8/19).
The patch fixes calculating the size of the table and emitting the unit length field. Differential Revision: https://reviews.llvm.org/D87017
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfStringPool.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfStringPool.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfStringPool.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfStringPool.cpp
index a43929d..731d7c1 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfStringPool.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfStringPool.cpp
@@ -58,13 +58,13 @@ void DwarfStringPool::emitStringOffsetsTableHeader(AsmPrinter &Asm,
if (getNumIndexedStrings() == 0)
return;
Asm.OutStreamer->SwitchSection(Section);
- unsigned EntrySize = 4;
- // FIXME: DWARF64
+ unsigned EntrySize = Asm.getDwarfOffsetByteSize();
// We are emitting the header for a contribution to the string offsets
// table. The header consists of an entry with the contribution's
// size (not including the size of the length field), the DWARF version and
// 2 bytes of padding.
- Asm.emitInt32(getNumIndexedStrings() * EntrySize + 4);
+ Asm.emitDwarfUnitLength(getNumIndexedStrings() * EntrySize + 4,
+ "Length of String Offsets Set");
Asm.emitInt16(Asm.getDwarfVersion());
Asm.emitInt16(0);
// Define the symbol that marks the start of the contribution. It is