mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-14 15:25:25 +00:00
Add a 'count' field to the DWARF subrange.
The count field is necessary because there isn't a difference between the 'lo' and 'hi' attributes for a one-element array and a zero-element array. When the count is '0', we know that this is a zero-element array. When it's >=1, then it's a normal constant sized array. When it's -1, then the array is unbounded. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169218 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1252,6 +1252,7 @@ void CompileUnit::constructSubrangeDIE(DIE &Buffer, DISubrange SR,
|
||||
addDIEEntry(DW_Subrange, dwarf::DW_AT_type, dwarf::DW_FORM_ref4, IndexTy);
|
||||
uint64_t L = SR.getLo();
|
||||
uint64_t H = SR.getHi();
|
||||
int64_t Count = SR.getCount();
|
||||
|
||||
// The L value defines the lower bounds which is typically zero for C/C++. The
|
||||
// H value is the upper bounds. Values are 64 bit. H - L + 1 is the size
|
||||
@@ -1265,7 +1266,8 @@ void CompileUnit::constructSubrangeDIE(DIE &Buffer, DISubrange SR,
|
||||
}
|
||||
if (L)
|
||||
addUInt(DW_Subrange, dwarf::DW_AT_lower_bound, 0, L);
|
||||
addUInt(DW_Subrange, dwarf::DW_AT_upper_bound, 0, H);
|
||||
if (H > 0 || Count != 0)
|
||||
addUInt(DW_Subrange, dwarf::DW_AT_upper_bound, 0, H);
|
||||
Buffer.addChild(DW_Subrange);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user