@@ -645,10 +645,11 @@ void COFFDumper::cacheRelocations() {
645
645
for (const SectionRef &S : Obj->sections ()) {
646
646
const coff_section *Section = Obj->getCOFFSection (S);
647
647
648
- append_range (RelocMap[Section], S.relocations ());
648
+ auto &RM = RelocMap[Section];
649
+ append_range (RM, S.relocations ());
649
650
650
651
// Sort relocations by address.
651
- llvm::sort (RelocMap[Section] , [](RelocationRef L, RelocationRef R) {
652
+ llvm::sort (RM , [](RelocationRef L, RelocationRef R) {
652
653
return L.getOffset () < R.getOffset ();
653
654
});
654
655
}
@@ -1270,14 +1271,15 @@ void COFFDumper::printCodeViewSymbolSection(StringRef SectionName,
1270
1271
reportError (errorCodeToError (EC), Obj->getFileName ());
1271
1272
1272
1273
W.printString (" LinkageName" , LinkageName);
1273
- if (FunctionLineTables.count (LinkageName) != 0 ) {
1274
+ auto [It, Inserted] =
1275
+ FunctionLineTables.try_emplace (LinkageName, Contents);
1276
+ if (!Inserted) {
1274
1277
// Saw debug info for this function already?
1275
1278
reportError (errorCodeToError (object_error::parse_failed),
1276
1279
Obj->getFileName ());
1277
1280
return ;
1278
1281
}
1279
1282
1280
- FunctionLineTables[LinkageName] = Contents;
1281
1283
FunctionNames.push_back (LinkageName);
1282
1284
break ;
1283
1285
}
0 commit comments