@@ -2202,36 +2202,36 @@ void DWARFLinker::DIECloner::generateLineTableForUnit(CompileUnit &Unit) {
2202
2202
DebugLineStrPool);
2203
2203
} else {
2204
2204
// Create TrackedRow objects for all input rows.
2205
- std::vector<TrackedRow> AllTrackedRows ;
2206
- AllTrackedRows .reserve (LT->Rows .size ());
2205
+ std::vector<TrackedRow> InputRows ;
2206
+ InputRows .reserve (LT->Rows .size ());
2207
2207
for (size_t i = 0 ; i < LT->Rows .size (); i++)
2208
- AllTrackedRows .emplace_back (TrackedRow{LT->Rows [i], i, false });
2208
+ InputRows .emplace_back (TrackedRow{LT->Rows [i], i, false });
2209
2209
2210
2210
// This vector is the output line table (still in TrackedRow form).
2211
- std::vector<TrackedRow> NewRows ;
2212
- NewRows .reserve (AllTrackedRows .size ());
2211
+ std::vector<TrackedRow> OutputRows ;
2212
+ OutputRows .reserve (InputRows .size ());
2213
2213
2214
2214
// Current sequence of rows being extracted, before being inserted
2215
- // in NewRows .
2215
+ // in OutputRows .
2216
2216
std::vector<TrackedRow> Seq;
2217
- Seq.reserve (AllTrackedRows .size ());
2217
+ Seq.reserve (InputRows .size ());
2218
2218
2219
2219
const auto &FunctionRanges = Unit.getFunctionRanges ();
2220
2220
std::optional<AddressRangeValuePair> CurrRange;
2221
2221
2222
2222
// FIXME: This logic is meant to generate exactly the same output as
2223
2223
// Darwin's classic dsymutil. There is a nicer way to implement this
2224
- // by simply putting all the relocated line info in NewRows and simply
2225
- // sorting NewRows before passing it to emitLineTableForUnit. This
2224
+ // by simply putting all the relocated line info in OutputRows and simply
2225
+ // sorting OutputRows before passing it to emitLineTableForUnit. This
2226
2226
// should be correct as sequences for a function should stay
2227
2227
// together in the sorted output. There are a few corner cases that
2228
2228
// look suspicious though, and that required to implement the logic
2229
2229
// this way. Revisit that once initial validation is finished.
2230
2230
2231
2231
// Iterate over the object file line info and extract the sequences
2232
2232
// that correspond to linked functions.
2233
- for (size_t i = 0 ; i < AllTrackedRows .size (); i++) {
2234
- TrackedRow TR = AllTrackedRows [i];
2233
+ for (size_t i = 0 ; i < InputRows .size (); i++) {
2234
+ TrackedRow TR = InputRows [i];
2235
2235
2236
2236
// Check whether we stepped out of the range. The range is
2237
2237
// half-open, but consider accepting the end address of the range if
@@ -2255,7 +2255,7 @@ void DWARFLinker::DIECloner::generateLineTableForUnit(CompileUnit &Unit) {
2255
2255
NextLine.Row .BasicBlock = 0 ;
2256
2256
NextLine.Row .EpilogueBegin = 0 ;
2257
2257
Seq.push_back (NextLine);
2258
- insertLineSequence (Seq, NewRows );
2258
+ insertLineSequence (Seq, OutputRows );
2259
2259
}
2260
2260
2261
2261
if (!CurrRange)
@@ -2271,13 +2271,13 @@ void DWARFLinker::DIECloner::generateLineTableForUnit(CompileUnit &Unit) {
2271
2271
Seq.push_back (TR);
2272
2272
2273
2273
if (TR.Row .EndSequence )
2274
- insertLineSequence (Seq, NewRows );
2274
+ insertLineSequence (Seq, OutputRows );
2275
2275
}
2276
2276
2277
2277
// Materialize the tracked rows into final DWARFDebugLine::Row objects.
2278
2278
LineTable.Rows .clear ();
2279
- LineTable.Rows .reserve (NewRows .size ());
2280
- for (auto &TR : NewRows )
2279
+ LineTable.Rows .reserve (OutputRows .size ());
2280
+ for (auto &TR : OutputRows )
2281
2281
LineTable.Rows .push_back (TR.Row );
2282
2282
2283
2283
// Use OutputRowOffsets to store the offsets of each line table row in the
@@ -2292,8 +2292,8 @@ void DWARFLinker::DIECloner::generateLineTableForUnit(CompileUnit &Unit) {
2292
2292
hasStmtSeq ? &OutputRowOffsets : nullptr );
2293
2293
2294
2294
if (hasStmtSeq) {
2295
- assert (OutputRowOffsets.size () == NewRows .size () &&
2296
- " OutputRowOffsets size mismatch " );
2295
+ assert (OutputRowOffsets.size () == OutputRows .size () &&
2296
+ " must have an offset for each row " );
2297
2297
2298
2298
// Create a map of stmt sequence offsets to original row indices.
2299
2299
DenseMap<uint64_t , unsigned > SeqOffToOrigRow;
@@ -2302,8 +2302,8 @@ void DWARFLinker::DIECloner::generateLineTableForUnit(CompileUnit &Unit) {
2302
2302
2303
2303
// Create a map of original row indices to new row indices.
2304
2304
DenseMap<size_t , size_t > OrigRowToNewRow;
2305
- for (size_t i = 0 ; i < NewRows .size (); ++i)
2306
- OrigRowToNewRow[NewRows [i].OriginalRowIndex ] = i;
2305
+ for (size_t i = 0 ; i < OutputRows .size (); ++i)
2306
+ OrigRowToNewRow[OutputRows [i].OriginalRowIndex ] = i;
2307
2307
2308
2308
// Patch DW_AT_LLVM_stmt_sequence attributes in the compile unit DIE
2309
2309
// with the correct offset into the .debug_line section.
0 commit comments