OSDN Git Service

[DebugInfo] Generate fixups as emitting DWARF .debug_line.
authorHsiangkai Wang <hsiangkai@gmail.com>
Wed, 1 Aug 2018 02:18:06 +0000 (02:18 +0000)
committerHsiangkai Wang <hsiangkai@gmail.com>
Wed, 1 Aug 2018 02:18:06 +0000 (02:18 +0000)
commit2bdc8dd491b9f68e3a905c92870d113d6ba39ba0
treeaf127ac27a5e7a789f2900a4ac19114a2cf7a3e0
parent59a658d8e2148310533292bc6713217d9329952c
[DebugInfo] Generate fixups as emitting DWARF .debug_line.

It is necessary to generate fixups in .debug_line as relaxation is
enabled due to the address delta may be changed after relaxation.

DWARF will record the mappings of lines and addresses in
.debug_line section. It will encode the information using special
opcodes, standard opcodes and extended opcodes in Line Number
Program. I use DW_LNS_fixed_advance_pc to encode fixed length
address delta and DW_LNE_set_address to encode absolute address
to make it possible to generate fixups in .debug_line section.

Differential Revision: https://reviews.llvm.org/D46850

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@338477 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/MC/MCDwarf.h
include/llvm/MC/MCFragment.h
lib/MC/MCAssembler.cpp
lib/MC/MCDwarf.cpp
test/DebugInfo/RISCV/lit.local.cfg [new file with mode: 0644]
test/DebugInfo/RISCV/relax-debug-line.ll [new file with mode: 0644]