@@ -1421,10 +1421,14 @@ void DwarfUnit::applySubprogramAttributes(const DISubprogram *SP, DIE &SPDie,
1421
1421
addFlag (SPDie, dwarf::DW_AT_deleted);
1422
1422
}
1423
1423
1424
- void DwarfUnit::constructSubrangeDIE (DIE &Buffer, const DISubrange *SR,
1425
- DIE *IndexTy) {
1424
+ void DwarfUnit::constructSubrangeDIE (DIE &Buffer, const DISubrange *SR) {
1426
1425
DIE &DW_Subrange = createAndAddDIE (dwarf::DW_TAG_subrange_type, Buffer);
1427
- addDIEEntry (DW_Subrange, dwarf::DW_AT_type, *IndexTy);
1426
+
1427
+ // Get an anonymous type for index type.
1428
+ // FIXME: This type should be passed down from the front end
1429
+ // as different languages may have different sizes for indexes.
1430
+ DIE *IdxTy = getIndexTyDie ();
1431
+ addDIEEntry (DW_Subrange, dwarf::DW_AT_type, *IdxTy);
1428
1432
1429
1433
// The LowerBound value defines the lower bounds which is typically zero for
1430
1434
// C/C++. The Count value is the number of elements. Values are 64 bit. If
@@ -1463,11 +1467,14 @@ void DwarfUnit::constructSubrangeDIE(DIE &Buffer, const DISubrange *SR,
1463
1467
}
1464
1468
1465
1469
void DwarfUnit::constructGenericSubrangeDIE (DIE &Buffer,
1466
- const DIGenericSubrange *GSR,
1467
- DIE *IndexTy) {
1470
+ const DIGenericSubrange *GSR) {
1468
1471
DIE &DwGenericSubrange =
1469
1472
createAndAddDIE (dwarf::DW_TAG_generic_subrange, Buffer);
1470
- addDIEEntry (DwGenericSubrange, dwarf::DW_AT_type, *IndexTy);
1473
+ // Get an anonymous type for index type.
1474
+ // FIXME: This type should be passed down from the front end
1475
+ // as different languages may have different sizes for indexes.
1476
+ DIE *IdxTy = getIndexTyDie ();
1477
+ addDIEEntry (DwGenericSubrange, dwarf::DW_AT_type, *IdxTy);
1471
1478
1472
1479
int64_t DefaultLowerBound = getDefaultLowerBound ();
1473
1480
@@ -1600,18 +1607,13 @@ void DwarfUnit::constructArrayTypeDIE(DIE &Buffer, const DICompositeType *CTy) {
1600
1607
// Emit the element type.
1601
1608
addType (Buffer, CTy->getBaseType ());
1602
1609
1603
- // Get an anonymous type for index type.
1604
- // FIXME: This type should be passed down from the front end
1605
- // as different languages may have different sizes for indexes.
1606
- DIE *IdxTy = getIndexTyDie ();
1607
-
1608
1610
// Add subranges to array type.
1609
1611
DINodeArray Elements = CTy->getElements ();
1610
1612
for (DINode *E : Elements) {
1611
1613
if (auto *Element = dyn_cast_or_null<DISubrange>(E))
1612
- constructSubrangeDIE (Buffer, Element, IdxTy );
1614
+ constructSubrangeDIE (Buffer, Element);
1613
1615
else if (auto *Element = dyn_cast_or_null<DIGenericSubrange>(E))
1614
- constructGenericSubrangeDIE (Buffer, Element, IdxTy );
1616
+ constructGenericSubrangeDIE (Buffer, Element);
1615
1617
}
1616
1618
}
1617
1619
0 commit comments