[llvm] r203821 - MCDwarf: Refactor line table handling into a single data structure

Rafael EspĂ­ndola rafael.espindola at gmail.com
Thu Mar 13 16:50:16 PDT 2014

> It would produce a smaller assembly file, I can't see how it would
> produce smaller line tables though.

Without it codegen will output a full address for each line. With .loc
MC can produce deltas.

It would be possible to have an implementation similar to what we do
with .cfi: The Streamer interface always uses cfi inspired directives
and the asm streamer converts it (when cfi is disabled).

In this case, it would mean that the streamer would get an call for
.file, .loc and ".offset_of_cu_in_debug_lines 0", but would process
that internally and print a .debug_line in the end. This would avoid
extending the assembly but:

* We would produce uglier assembly.
* We would need to do a lot more in the asm streamer. In particular,
we would have to relax instructions to find their final size. We would
also have to make sure that instructions are printed in an completely
unambiguous way. If we think a branch is 16 bits and gas relaxation
produces a larger one, we have a problem.


More information about the llvm-commits mailing list