@@ -142,13 +142,13 @@ CallStackMap readStackInfo(const char *Ptr) {
142
142
// any stack ids observed previously map to a different set of program counter
143
143
// addresses.
144
144
bool mergeStackMap (const CallStackMap &From, CallStackMap &To) {
145
- for (const auto &IdStack : From) {
146
- auto I = To.find (IdStack. first );
145
+ for (const auto &[Id, Stack] : From) {
146
+ auto I = To.find (Id );
147
147
if (I == To.end ()) {
148
- To[IdStack. first ] = IdStack. second ;
148
+ To[Id ] = Stack ;
149
149
} else {
150
150
// Check that the PCs are the same (in order).
151
- if (IdStack. second != I->second )
151
+ if (Stack != I->second )
152
152
return true ;
153
153
}
154
154
}
@@ -275,10 +275,10 @@ void RawMemProfReader::printYAML(raw_ostream &OS) {
275
275
}
276
276
// Print out the merged contents of the profiles.
277
277
OS << " Records:\n " ;
278
- for (const auto &Entry : *this ) {
278
+ for (const auto &[GUID, Record] : *this ) {
279
279
OS << " -\n " ;
280
- OS << " FunctionGUID: " << Entry. first << " \n " ;
281
- Entry. second .print (OS);
280
+ OS << " FunctionGUID: " << GUID << " \n " ;
281
+ Record .print (OS);
282
282
}
283
283
}
284
284
@@ -405,9 +405,7 @@ Error RawMemProfReader::mapRawProfileToRecords() {
405
405
406
406
// Convert the raw profile callstack data into memprof records. While doing so
407
407
// keep track of related contexts so that we can fill these in later.
408
- for (const auto &Entry : CallstackProfileData) {
409
- const uint64_t StackId = Entry.first ;
410
-
408
+ for (const auto &[StackId, MIB] : CallstackProfileData) {
411
409
auto It = StackMap.find (StackId);
412
410
if (It == StackMap.end ())
413
411
return make_error<InstrProfError>(
@@ -455,7 +453,7 @@ Error RawMemProfReader::mapRawProfileToRecords() {
455
453
auto Result =
456
454
FunctionProfileData.insert ({F.Function , IndexedMemProfRecord ()});
457
455
IndexedMemProfRecord &Record = Result.first ->second ;
458
- Record.AllocSites .emplace_back (Callstack, CSId, Entry. second );
456
+ Record.AllocSites .emplace_back (Callstack, CSId, MIB );
459
457
460
458
if (!F.IsInlineFrame )
461
459
break ;
0 commit comments