[llvm-commits] [llvm] r169218 - in /llvm/trunk: include/llvm/ lib/CodeGen/AsmPrinter/ lib/VMCore/ test/CodeGen/ARM/ test/CodeGen/Thumb/ test/CodeGen/X86/ test/DebugInfo/ test/DebugInfo/X86/ test/JitListener/

Robinson, Paul Paul.Robinson at am.sony.com
Tue Dec 4 14:22:44 PST 2012


> Bill Wendling:
>> DWARF wants you to omit DW_AT_upper_bound when the upper bound is unknown.
>> I think this code does not achieve that effect when the Count == -1:
>> 
>In the case that Count == -1, it won't get to this code because L == 1 and H == 0.

Okay, I should've looked at more context than the diff showed.  I was
assuming the subrange handling was more language-neutral.

As far as the patch's purpose goes, it looks okay.  But the treatment
of subranges in general leaves something to be desired.

When L == 0 we don't emit the lower bound; this is permissible for
languages that default to a lower bound of zero, but not for languages
that have other defaults (or no default).  LLVM does support non-C-family
languages via Dragonegg; FORTRAN and Ada are especially mentioned on the
LLVM home page, and their default lower-bound is 1 not 0.

I think Ada supports subrange types directly, not just as array bounds,
in which case omitting either bound is incorrect.  I don't know whether
Dragonegg supports describing subrange types in DWARF though.

> Eric Christopher:
>> And I don't see that the tests verify that you actually omit
>> DW_AT_upper_bound for that case.
>
> This test will have tested that:

Ah, missed that one.  Sorry about that, Chief!
--paulr




More information about the llvm-commits mailing list