summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2015-04-07 22:46:01 +0000
committerRui Ueyama <ruiu@google.com>2015-04-07 22:46:01 +0000
commit9a736cf29fc13c6330e0c7d43dec15168fe14b1f (patch)
treea55361a8e04bfedd94eeac38c997dcc40fab77ba
parent6cd2180b31a2f01942204e95f8ef38818f382360 (diff)
downloadbcm5719-llvm-9a736cf29fc13c6330e0c7d43dec15168fe14b1f.tar.gz
bcm5719-llvm-9a736cf29fc13c6330e0c7d43dec15168fe14b1f.zip
ELF: Minor simplification.
MergeSectionKey is a tiny struct. We don't need a constructor for that. The good old way to initialize a struct works fine. llvm-svn: 234371
-rw-r--r--lld/lib/ReaderWriter/ELF/ELFFile.h7
1 files changed, 2 insertions, 5 deletions
diff --git a/lld/lib/ReaderWriter/ELF/ELFFile.h b/lld/lib/ReaderWriter/ELF/ELFFile.h
index a74b2091982..f1a7ffeb120 100644
--- a/lld/lib/ReaderWriter/ELF/ELFFile.h
+++ b/lld/lib/ReaderWriter/ELF/ELFFile.h
@@ -34,9 +34,6 @@ template <class ELFT> class ELFFile : public SimpleFile {
// A Map is used to hold the atoms that have been divided up
// after reading the section that contains Merge String attributes
struct MergeSectionKey {
- MergeSectionKey(const Elf_Shdr *shdr, int64_t offset)
- : _shdr(shdr), _offset(offset) {}
- // Data members
const Elf_Shdr *_shdr;
int64_t _offset;
};
@@ -343,7 +340,7 @@ protected:
unsigned int offset) {
ELFMergeAtom<ELFT> *mergeAtom = new (_readerStorage)
ELFMergeAtom<ELFT>(*this, sectionName, sectionHdr, contentData, offset);
- const MergeSectionKey mergedSectionKey(sectionHdr, offset);
+ const MergeSectionKey mergedSectionKey = {sectionHdr, offset};
if (_mergedSectionMap.find(mergedSectionKey) == _mergedSectionMap.end())
_mergedSectionMap.insert(std::make_pair(mergedSectionKey, mergeAtom));
return mergeAtom;
@@ -1008,7 +1005,7 @@ void ELFFile<ELFT>::updateReferenceForMergeStringAccess(ELFReference<ELFT> *ref,
if (addend < 0)
addend = 0;
- const MergeSectionKey ms(shdr, addend);
+ const MergeSectionKey ms = {shdr, addend};
auto msec = _mergedSectionMap.find(ms);
if (msec != _mergedSectionMap.end()) {
ref->setTarget(msec->second);
OpenPOWER on IntegriCloud