Do not lookup a DenseMap twice using the same key.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295124 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rui Ueyama 2017-02-14 23:47:34 +00:00
parent d5265b3065
commit 7c1b5b039c

View File

@ -230,13 +230,10 @@ COFFSymbol *WinCOFFObjectWriter::createSymbol(StringRef Name) {
}
COFFSymbol *WinCOFFObjectWriter::GetOrCreateCOFFSymbol(const MCSymbol *Symbol) {
symbol_map::iterator i = SymbolMap.find(Symbol);
if (i != SymbolMap.end())
return i->second;
COFFSymbol *RetSymbol =
createCOFFEntity<COFFSymbol>(Symbol->getName(), Symbols);
SymbolMap[Symbol] = RetSymbol;
return RetSymbol;
COFFSymbol *&Ret = SymbolMap[Symbol];
if (!Ret)
Ret = createCOFFEntity<COFFSymbol>(Symbol->getName(), Symbols);
return Ret;
}
COFFSection *WinCOFFObjectWriter::createSection(StringRef Name) {