summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
diff options
context:
space:
mode:
authorWolfgang Pieb <Wolfgang.Pieb@sony.com>2019-02-01 17:11:58 +0000
committerWolfgang Pieb <Wolfgang.Pieb@sony.com>2019-02-01 17:11:58 +0000
commit58513b7761a92da26be08daa77329c5bc5b1a675 (patch)
tree4c352f9af83d85965ccba07a6b3582ecd4a60aaf /llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
parent18886db211939c965a843efc6472f3c6b2abf65d (diff)
downloadbcm5719-llvm-58513b7761a92da26be08daa77329c5bc5b1a675.tar.gz
bcm5719-llvm-58513b7761a92da26be08daa77329c5bc5b1a675.zip
[DWARF v5] Fix DWARF emitter and consumer to produce/expect a uleb for a location description's length.
Reviewer: davide, JDevliegere Differential Revision: https://reviews.llvm.org/D57550 llvm-svn: 352889
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index 02bee78af9e..0bbd54f5411 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -1978,8 +1978,10 @@ void DebugLocEntry::finalize(const AsmPrinter &AP,
void DwarfDebug::emitDebugLocEntryLocation(const DebugLocStream::Entry &Entry) {
// Emit the size.
Asm->OutStreamer->AddComment("Loc expr size");
- Asm->emitInt16(DebugLocs.getBytes(Entry).size());
-
+ if (getDwarfVersion() >= 5)
+ Asm->EmitULEB128(DebugLocs.getBytes(Entry).size());
+ else
+ Asm->emitInt16(DebugLocs.getBytes(Entry).size());
// Emit the entry.
APByteStreamer Streamer(*Asm);
emitDebugLocEntry(Streamer, Entry);
OpenPOWER on IntegriCloud