diff options
Diffstat (limited to 'llvm/lib/MC/MCDwarf.cpp')
-rw-r--r-- | llvm/lib/MC/MCDwarf.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/llvm/lib/MC/MCDwarf.cpp b/llvm/lib/MC/MCDwarf.cpp index 0461c2564cc..9574379d78d 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 |