Skip to content

Commit fbc67cd

Browse files
committed
fix
1 parent 333178f commit fbc67cd

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include "llvm/IR/DebugInfo.h"
2828
#include "llvm/IR/GlobalVariable.h"
2929
#include "llvm/MC/MCAsmInfo.h"
30+
#include "llvm/MC/MCObjectStreamer.h"
3031
#include "llvm/MC/MCSection.h"
3132
#include "llvm/MC/MCStreamer.h"
3233
#include "llvm/MC/MCSymbol.h"
@@ -494,7 +495,7 @@ void DwarfCompileUnit::attachLowHighPC(DIE &D, const MCSymbol *Begin,
494495

495496
addLabelAddress(D, dwarf::DW_AT_low_pc, Begin);
496497
if (DD->getDwarfVersion() >= 4 &&
497-
(!isDwoUnit() || !llvm::isRangeRelaxable(Begin, End))) {
498+
(!isDwoUnit() || llvm::absoluteSymbolDiff(Begin, End).has_value())) {
498499
addLabelDelta(D, dwarf::DW_AT_high_pc, End, Begin);
499500
return;
500501
}

llvm/test/DebugInfo/X86/fission-ranges.ll

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,21 +45,21 @@
4545
; if they've changed due to a bugfix, change in register allocation, etc.
4646

4747
; CHECK: [[A]]:
48-
; CHECK-NEXT: DW_LLE_startx_length (0x00000001, 0x00000011): DW_OP_consts +0, DW_OP_stack_value
49-
; CHECK-NEXT: DW_LLE_startx_length (0x00000002, 0x0000000b): DW_OP_reg0 RAX
50-
; CHECK-NEXT: DW_LLE_startx_length (0x00000003, 0x00000012): DW_OP_breg7 RSP-4
48+
; CHECK-NEXT: DW_LLE_startx_length (0x00000002, 0x00000011): DW_OP_consts +0, DW_OP_stack_value
49+
; CHECK-NEXT: DW_LLE_startx_length (0x00000004, 0x0000000b): DW_OP_reg0 RAX
50+
; CHECK-NEXT: DW_LLE_startx_length (0x00000005, 0x00000012): DW_OP_breg7 RSP-4
5151
; CHECK-NEXT: DW_LLE_end_of_list ()
5252
; CHECK: [[E]]:
53-
; CHECK-NEXT: DW_LLE_startx_length (0x00000004, 0x0000000b): DW_OP_reg0 RAX
54-
; CHECK-NEXT: DW_LLE_startx_length (0x00000005, 0x0000005a): DW_OP_breg7 RSP-36
53+
; CHECK-NEXT: DW_LLE_startx_length (0x00000006, 0x0000000b): DW_OP_reg0 RAX
54+
; CHECK-NEXT: DW_LLE_startx_length (0x00000007, 0x0000005a): DW_OP_breg7 RSP-36
5555
; CHECK-NEXT: DW_LLE_end_of_list ()
5656
; CHECK: [[B]]:
57-
; CHECK-NEXT: DW_LLE_startx_length (0x00000006, 0x0000000b): DW_OP_reg0 RAX
58-
; CHECK-NEXT: DW_LLE_startx_length (0x00000007, 0x00000042): DW_OP_breg7 RSP-24
57+
; CHECK-NEXT: DW_LLE_startx_length (0x00000008, 0x0000000b): DW_OP_reg0 RAX
58+
; CHECK-NEXT: DW_LLE_startx_length (0x00000009, 0x00000042): DW_OP_breg7 RSP-24
5959
; CHECK-NEXT: DW_LLE_end_of_list ()
6060
; CHECK: [[D]]:
61-
; CHECK-NEXT: DW_LLE_startx_length (0x00000008, 0x0000000b): DW_OP_reg0 RAX
62-
; CHECK-NEXT: DW_LLE_startx_length (0x00000009, 0x0000002a): DW_OP_breg7 RSP-12
61+
; CHECK-NEXT: DW_LLE_startx_length (0x0000000a, 0x0000000b): DW_OP_reg0 RAX
62+
; CHECK-NEXT: DW_LLE_startx_length (0x0000000b, 0x0000002a): DW_OP_breg7 RSP-12
6363
; CHECK-NEXT: DW_LLE_end_of_list ()
6464

6565
; Make sure we don't produce any relocations in any .dwo section (though in particular, debug_info.dwo)
@@ -69,7 +69,7 @@
6969
; (9 is the last index in debug_loc.dwo, making 10 entries of 8 bytes each,
7070
; 10 * 8 == 80 base 10 == 50 base 16)
7171

72-
; HDR: .debug_addr 00000050
72+
; HDR: .debug_addr 00000060
7373
; HDR-NOT: .rela.{{.*}}.dwo
7474

7575
; Check for the existence of a DWARF v5-style range list table in the .debug_rnglists

0 commit comments

Comments
 (0)