@@ -3077,11 +3077,9 @@ std::pair<uint32_t, uint32_t> DebugNamesBaseSection::computeEntryPool(
3077
3077
// Abbrevs are indexed starting at 1; vector starts at 0. (abbrevCode
3078
3078
// corresponds to position in the merged table vector).
3079
3079
const Abbrev *abbrev = abbrevTable[ie.abbrevCode - 1 ];
3080
- for (auto i : seq (abbrev->attributes .size ())) {
3081
- DWARFDebugNames::AttributeEncoding a = abbrev->attributes [i];
3080
+ for (auto &[a, v] : zip_equal (abbrev->attributes , ie.attrValues ))
3082
3081
if (a.Index == DW_IDX_parent && a.Form == DW_FORM_ref4)
3083
- ie.attrValues [i].attrValue = ie.parentEntry ->poolOffset ;
3084
- }
3082
+ v.attrValue = ie.parentEntry ->poolOfset ;
3085
3083
}
3086
3084
}
3087
3085
});
@@ -3232,8 +3230,8 @@ template <class ELFT> void DebugNamesSection<ELFT>::writeTo(uint8_t *buf) {
3232
3230
buf += hdr.AugmentationStringSize ;
3233
3231
3234
3232
// Write the CU list.
3235
- for (auto i : seq (numChunks) )
3236
- for (uint32_t cuOffset : chunks[i] .compUnits )
3233
+ for (OutputChunk &chunk : chunks )
3234
+ for (uint32_t cuOffset : chunk .compUnits )
3237
3235
endian::writeNext<uint32_t , ELFT::Endianness>(buf, cuOffset);
3238
3236
3239
3237
// Write the local TU list, then the foreign TU list..
@@ -3275,8 +3273,7 @@ template <class ELFT> void DebugNamesSection<ELFT>::writeTo(uint8_t *buf) {
3275
3273
endian::writeNext<uint32_t , ELFT::Endianness>(buf, ne->entryOffset );
3276
3274
3277
3275
// Write the abbrev table.
3278
- memcpy (buf, abbrevTableBuf.data (), abbrevTableBuf.size ());
3279
- buf += abbrevTableBuf.size ();
3276
+ buf = llvm::copy (abbrevTableBuf, buf);
3280
3277
3281
3278
// Write the entry pool. Unlike the name table, the name entries follow the
3282
3279
// nameVecs order computed by `computeEntryPool`.
0 commit comments