mirror of
https://github.com/RPCSX/llvm.git
synced 2025-01-19 02:42:58 +00:00
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:
parent
d5265b3065
commit
7c1b5b039c
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user