[MC/DWARF] Support .debug_frame / .debug_line code alignment factors

Rafael EspĂ­ndola rafael.espindola at gmail.com
Wed Jun 12 05:40:50 PDT 2013


Calling the field MinInstLength is a bit odd. An architecture where
instructions are 4 or 5 would have to set this to 1. Something like
MinInstAlignment would be more correct.

Do we have sufficient asm parser support to replace
ppc64-initial-cfa.ll with a llvm-mc test?

LGTM with those changes.

On 7 June 2013 13:09, Ulrich Weigand <Ulrich.Weigand at de.ibm.com> wrote:
>
> Hello,
>
> I've been comparing the object file output of LLVM's integrated
> assembler against the external assembler on PowerPC, and one
> area where differences still remain are in DWARF sections.
>
> In particular, the GNU assembler generates .debug_frame and
> .debug_line sections using a code alignment factor of 4, since
> all PowerPC instructions have size 4 and must be aligned to a
> multiple of 4.  However, current MC code hard-codes a code
> alignment factor of 1.
>
> This patch changes this by adding a "minimum instruction length"
> data element to MCAsmInfo and using this as code alignment factor.
>
> This requires passing a MCContext into MCDwarfLineAddr::Encode
> and MCDwarfLineAddr::EncodeAdvanceLoc.  Note that one caller,
> MCDwarfLineAddr::Write, didn't actually have that information
> available.  However, it turns out that this routine is in fact
> never used in the whole code base, so the patch simply removes
> it.  If it turns out to be needed again at a later time, it
> could be re-added with an updated interface.
>
> Does this look OK?
>
> Thanks,
> Ulrich
> (See attached file: diff-llvm-mc-codealignment)
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>



More information about the llvm-commits mailing list