[llvm] r204697 - DebugInfo: Support debug_loc under fission

Eric Christopher echristo at gmail.com
Mon Mar 31 15:46:20 PDT 2014


> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/Dwarf.h?rev=204697&r1=204696&r2=204697&view=diff
> ==============================================================================
> --- llvm/trunk/include/llvm/Support/Dwarf.h (original)
> +++ llvm/trunk/include/llvm/Support/Dwarf.h Mon Mar 24 20:44:02 2014
> @@ -771,6 +771,14 @@ enum Constants {
>    DW_EH_PE_indirect = 0x80
>  };
>
> +enum LocationListEntry : unsigned char {
> +  DW_LLE_end_of_list_entry,
> +  DW_LLE_base_address_selection_entry,
> +  DW_LLE_start_end_entry,
> +  DW_LLE_start_length_entry,
> +  DW_LLE_offset_pair_entry
> +};

Can you go ahead and comment this as being a DWARF5/fission feature
that's subject to change? I tried to do this for the rest of them, but
don't recall how successful I was.

> -      if (CU->getRanges().size() == 1) {
> +      if (useSplitDwarf()) {
> +        // Just always use start_length for now - at least that's one address
> +        // rather than two. We could get fancier and try to, say, reuse an
> +        // address we know we've emitted elsewhere (the start of the function?
> +        // The start of the CU or CU subrange that encloses this range?)
> +        Asm->EmitInt8(dwarf::DW_LLE_start_length_entry);
> +        unsigned idx = InfoHolder.getAddrPoolIndex(Entry.getBeginSym());
> +        Asm->EmitULEB128(idx);
> +        Asm->EmitLabelDifference(Entry.getEndSym(), Entry.getBeginSym(), 4);

With the way this looks along-side the comment I'd almost rather two
functions and split the emission that way.

*shrug*

>
> Modified: llvm/trunk/lib/DebugInfo/DWARFContext.cpp

Would have been nice to split the dumping out to a separate commit :)


Looks great otherwise, thanks!

-eric



More information about the llvm-commits mailing list