[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)
commit5c63af0d040a377c4fe13a75dea5bb6f84116b9e
tree8df74eeda05e08aa0508669022ca335bbb73e3dd
parent6cdfe29d8efaa6987fe708963d65096689f72b14
[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

llvm-svn: 338477
llvm/include/llvm/MC/MCDwarf.h
llvm/include/llvm/MC/MCFragment.h
llvm/lib/MC/MCAssembler.cpp
llvm/lib/MC/MCDwarf.cpp
llvm/test/DebugInfo/RISCV/lit.local.cfg [new file with mode: 0644]
llvm/test/DebugInfo/RISCV/relax-debug-line.ll [new file with mode: 0644]