[lld] r177563 - [ELF][Reader][Perf] Only do loookup once.
Michael J. Spencer
bigcheesegs at gmail.com
Wed Mar 20 12:25:59 PDT 2013
Author: mspencer
Date: Wed Mar 20 14:25:58 2013
New Revision: 177563
URL: http://llvm.org/viewvc/llvm-project?rev=177563&view=rev
Log:
[ELF][Reader][Perf] Only do loookup once.
Modified:
lld/trunk/lib/ReaderWriter/ELF/File.h
Modified: lld/trunk/lib/ReaderWriter/ELF/File.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/File.h?rev=177563&r1=177562&r2=177563&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/File.h (original)
+++ lld/trunk/lib/ReaderWriter/ELF/File.h Wed Mar 20 14:25:58 2013
@@ -516,7 +516,8 @@ public:
int64_t relocAddend = relHandler.relocAddend(*ri);
uint64_t addend = ri->addend() + relocAddend;
const MergeSectionKey ms(shdr, addend);
- if (_mergedSectionMap.find(ms) == _mergedSectionMap.end()) {
+ auto msec = _mergedSectionMap.find(ms);
+ if (msec == _mergedSectionMap.end()) {
if (Symbol->getType() != llvm::ELF::STT_SECTION)
addend = Symbol->st_value + addend;
MergeAtomsIter mai = findMergeAtom(shdr, addend);
@@ -529,7 +530,7 @@ public:
llvm_unreachable("unable to find a merge atom");
} // find
else
- ri->setTarget(_mergedSectionMap[ms]);
+ ri->setTarget(msec->second);
} else
ri->setTarget(findAtom(Symbol));
}
More information about the llvm-commits
mailing list