@@ -645,10 +645,11 @@ void COFFDumper::cacheRelocations() {
645645 for (const SectionRef &S : Obj->sections ()) {
646646 const coff_section *Section = Obj->getCOFFSection (S);
647647
648- append_range (RelocMap[Section], S.relocations ());
648+ auto &RM = RelocMap[Section];
649+ append_range (RM, S.relocations ());
649650
650651 // Sort relocations by address.
651- llvm::sort (RelocMap[Section] , [](RelocationRef L, RelocationRef R) {
652+ llvm::sort (RM , [](RelocationRef L, RelocationRef R) {
652653 return L.getOffset () < R.getOffset ();
653654 });
654655 }
@@ -1270,14 +1271,15 @@ void COFFDumper::printCodeViewSymbolSection(StringRef SectionName,
12701271 reportError (errorCodeToError (EC), Obj->getFileName ());
12711272
12721273 W.printString (" LinkageName" , LinkageName);
1273- if (FunctionLineTables.count (LinkageName) != 0 ) {
1274+ auto [It, Inserted] =
1275+ FunctionLineTables.try_emplace (LinkageName, Contents);
1276+ if (!Inserted) {
12741277 // Saw debug info for this function already?
12751278 reportError (errorCodeToError (object_error::parse_failed),
12761279 Obj->getFileName ());
12771280 return ;
12781281 }
12791282
1280- FunctionLineTables[LinkageName] = Contents;
12811283 FunctionNames.push_back (LinkageName);
12821284 break ;
12831285 }
0 commit comments