llvm-project
e0a59728 - Allow 128-bit bounds in DISubrangeType (#231928)

Commit
30 days ago
Allow 128-bit bounds in DISubrangeType (#231928) When adding DISubrangeType, I neglected to account for the case of 128-bit array bounds. While unusual, this is valid in Ada, and a type like this will cause a crash in LLVM: type Big_Range is range 2**127 - 15 .. 2**127 - 1; type Big_Array is array (Big_Range) of Boolean; This patch adds support for this situation to DISubrangeType. DISubrange is not modified, as gnat-llvm does not need this. Some extra work was needed in the DWARF writer. In particular, DW_AT_lower_bound (et al) are in both the 'constant' and 'exprloc' class, and so DW_FORM_block* will be interpreted as an expression -- one of the many weirdnesses of DWARF. To handle this, I've added support for emitting these attributes using DW_FORM_data16. You'll note that the code preserve the use of DW_FORM_udata and DW_FORM_sdata. This is done to preserve compatibility; in particular using narrower forms here can run into confusion about sign extension in DWARF readers.
Author
Parents
Loading