diff --git a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp index 92f37c22ae513..25b76c7668350 100644 --- a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp +++ b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp @@ -1610,13 +1610,10 @@ RuntimeDyldELF::processRelocationRef( RelocationEntry RE(SectionID, Offset, RelType, Value.Addend); if (r_type == ELF::R_MIPS_CALL16 || r_type == ELF::R_MIPS_GOT_PAGE || r_type == ELF::R_MIPS_GOT_DISP) { - StringMap::iterator i = GOTSymbolOffsets.find(TargetName); - if (i != GOTSymbolOffsets.end()) - RE.SymOffset = i->second; - else { - RE.SymOffset = allocateGOTEntries(1); - GOTSymbolOffsets[TargetName] = RE.SymOffset; - } + auto [I, Inserted] = GOTSymbolOffsets.try_emplace(TargetName); + if (Inserted) + I->second = allocateGOTEntries(1); + RE.SymOffset = I->second; if (Value.SymbolName) addRelocationForSymbol(RE, Value.SymbolName); else