aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/MC/MCDwarf.cpp
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2018-08-08 21:16:50 +0000
committerJonas Devlieghere <jonas@devlieghere.com>2018-08-08 21:16:50 +0000
commit49ff4d904148125cad66a8df33b7033390068310 (patch)
treea766fac650929494f517dfbf9232ac9f044073b9 /llvm/lib/MC/MCDwarf.cpp
parent9ff024a54fefa08cb93065e25ecbb974b74bc6e4 (diff)
downloadllvm-49ff4d904148125cad66a8df33b7033390068310.zip
llvm-49ff4d904148125cad66a8df33b7033390068310.tar.gz
llvm-49ff4d904148125cad66a8df33b7033390068310.tar.bz2
[DWARF] Unclamp line table version on Darwin for v5 and later.
On Darwin we pin the DWARF line tables to version 2. Stop doing so for DWARF v5 and later. Differential revision: https://reviews.llvm.org/D49381 llvm-svn: 339288
Diffstat (limited to 'llvm/lib/MC/MCDwarf.cpp')
-rw-r--r--llvm/lib/MC/MCDwarf.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/llvm/lib/MC/MCDwarf.cpp b/llvm/lib/MC/MCDwarf.cpp
index 0461c25..9574379 100644
--- a/llvm/lib/MC/MCDwarf.cpp
+++ b/llvm/lib/MC/MCDwarf.cpp
@@ -462,11 +462,14 @@ MCDwarfLineTableHeader::Emit(MCStreamer *MCOS, MCDwarfLineTableParams Params,
emitAbsValue(*MCOS,
MakeStartMinusEndExpr(*MCOS, *LineStartSym, *LineEndSym, 4), 4);
- // Next 2 bytes is the Version.
- // FIXME: On Darwin we still default to V2.
unsigned LineTableVersion = context.getDwarfVersion();
- if (context.getObjectFileInfo()->getTargetTriple().isOSDarwin())
+
+ // On Darwin we default to v2 for anything before DWARF v5.
+ if (context.getObjectFileInfo()->getTargetTriple().isOSDarwin() &&
+ LineTableVersion < 5)
LineTableVersion = 2;
+
+ // Next 2 bytes is the Version.
MCOS->EmitIntValue(LineTableVersion, 2);
// Keep track of the bytes between the very start and where the header length