[lld] r334705 - [ELF][MIPS] Replace calls to MapVector::find by MapVector::lookup. NFC

Simon Atanasyan via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 14 04:53:31 PDT 2018


Author: atanasyan
Date: Thu Jun 14 04:53:31 2018
New Revision: 334705

URL: http://llvm.org/viewvc/llvm-project?rev=334705&view=rev
Log:
[ELF][MIPS] Replace calls to MapVector::find by MapVector::lookup. NFC

Modified:
    lld/trunk/ELF/SyntheticSections.cpp

Modified: lld/trunk/ELF/SyntheticSections.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/SyntheticSections.cpp?rev=334705&r1=334704&r2=334705&view=diff
==============================================================================
--- lld/trunk/ELF/SyntheticSections.cpp (original)
+++ lld/trunk/ELF/SyntheticSections.cpp Thu Jun 14 04:53:31 2018
@@ -728,22 +728,22 @@ uint64_t MipsGotSection::getSymEntryOffs
   const FileGot &G = Gots[*F->MipsGotIndex];
   Symbol *Sym = const_cast<Symbol *>(&S);
   if (Sym->isTls())
-    return G.Tls.find(Sym)->second * Config->Wordsize;
+    return G.Tls.lookup(Sym) * Config->Wordsize;
   if (Sym->IsPreemptible)
-    return G.Global.find(Sym)->second * Config->Wordsize;
-  return G.Local16.find({Sym, Addend})->second * Config->Wordsize;
+    return G.Global.lookup(Sym) * Config->Wordsize;
+  return G.Local16.lookup({Sym, Addend}) * Config->Wordsize;
 }
 
 uint64_t MipsGotSection::getTlsIndexOffset(const InputFile *F) const {
   const FileGot &G = Gots[*F->MipsGotIndex];
-  return G.DynTlsSymbols.find(nullptr)->second * Config->Wordsize;
+  return G.DynTlsSymbols.lookup(nullptr) * Config->Wordsize;
 }
 
 uint64_t MipsGotSection::getGlobalDynOffset(const InputFile *F,
                                             const Symbol &S) const {
   const FileGot &G = Gots[*F->MipsGotIndex];
   Symbol *Sym = const_cast<Symbol *>(&S);
-  return G.DynTlsSymbols.find(Sym)->second * Config->Wordsize;
+  return G.DynTlsSymbols.lookup(Sym) * Config->Wordsize;
 }
 
 const Symbol *MipsGotSection::getFirstGlobalEntry() const {




More information about the llvm-commits mailing list