llvm.org GIT mirror llvm / 7129970
[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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339288 91177308-0d34-0410-b5e6-96231b3b80d8 Jonas Devlieghere 2 years ago
5 changed file(s) with 13 addition(s) and 14 deletion(s). Raw diff Collapse all Expand all
461461 emitAbsValue(*MCOS,
462462 MakeStartMinusEndExpr(*MCOS, *LineStartSym, *LineEndSym, 4), 4);
463463
464 unsigned LineTableVersion = context.getDwarfVersion();
465
466 // On Darwin we default to v2 for anything before DWARF v5.
467 if (context.getObjectFileInfo()->getTargetTriple().isOSDarwin() &&
468 LineTableVersion < 5)
469 LineTableVersion = 2;
470
464471 // Next 2 bytes is the Version.
465 // FIXME: On Darwin we still default to V2.
466 unsigned LineTableVersion = context.getDwarfVersion();
467 if (context.getObjectFileInfo()->getTargetTriple().isOSDarwin())
468 LineTableVersion = 2;
469472 MCOS->EmitIntValue(LineTableVersion, 2);
470473
471474 // Keep track of the bytes between the very start and where the header length
0 ; MD5 checksums provided by IR should be passed through to asm.
11 ; They'll be emitted to an object file only for DWARF 5 or later.
2
3 ; Darwin clamps the line table at DWARF v2 so XFAIL this test.
4 ; XFAIL: darwin
2 ;
3 ; Note that on Darwin for DWARF 4 or earlier, the line table version is clamped
4 ; to version 2. However that doesn't affect the output checked in this test.
55
66 ; REQUIRES: object-emission
77 ; RUN: %llc_dwarf -dwarf-version 4 -filetype=asm -o - %s | FileCheck %s --check-prefix=ASM-4
0 ; Source text provided by IR should be passed through to asm.
11 ; It is emitted to an object file only for DWARF 5 or later.
2
3 ; Darwin clamps the line table at DWARF v2 so XFAIL this test.
4 ; XFAIL: darwin
2 ;
3 ; Note that on Darwin for DWARF 4 or earlier, the line table version is clamped
4 ; to version 2. However that doesn't affect the output checked in this test.
55
66 ; REQUIRES: object-emission
77 ; RUN: %llc_dwarf -dwarf-version 4 -filetype=asm -o - %s | FileCheck %s --check-prefix=ASM-4
33 # RUN: llvm-mc -dwarf-version 4 %s -filetype=asm -o - 2>&1 | FileCheck %s --check-prefix=WARN
44 # RUN: llvm-mc -dwarf-version 5 %s -filetype=obj -o - | llvm-dwarfdump -debug-line - | FileCheck %s --check-prefixes=CHECK,CHECK-5
55 # RUN: llvm-mc -dwarf-version 5 %s -filetype=asm -o - | FileCheck %s --check-prefixes=ASM,ASM-5
6 # Darwin is stuck on DWARF v2.
7 # XFAIL: darwin
86 .file 0 "/test" "root.cpp"
97 .file 1 "/include" "header.h"
108 .file 2 "/test" "root.cpp"
0 # REQUIRES: default_triple
11 # RUN: llvm-mc -dwarf-version 5 %s -filetype=obj -o - | llvm-dwarfdump -debug-line - | FileCheck %s
22 # RUN: not llvm-mc -dwarf-version 4 %s -filetype=asm -o - 2>&1 | FileCheck %s -check-prefix=ERR
3 # Darwin line table is stuck on DWARF v2.
4 # XFAIL: darwin
53 # Show that ".loc 0" works in DWARF v5, gets an error for earlier versions.
64 .file 0 "root.cpp"
75 .file 1 "header.h"